n,k=map(int,input().split()) a=list(map(int,input().split())) a.sort() cnt=0 for i in range(n): if k>=a[i]: cnt+=1 k-=a[i] else: break print(cnt, k)