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