n,k = map(int,input().split()) A = sorted(list(map(int,input().split()))) + [10**10] for i,a in enumerate(A): if a > k: print(i,k) exit() k -= a