N,K=map(int,input().split()) A=list(map(int,input().split())) A.sort() for i in range(N): if A[i]<=K: K-=A[i] else: print(i,K) break else: print(N,K)