N,K=map(int,input().split()) A=list(map(int,input().split())) A.sort() ans=0 for a in A: if a<=K: ans+=1 K-=a else: break print(ans,K)