N, K = map(int, input().split()) A = list(map(int, input().split())) A.sort() s=0 q=K for i in A: if q>=i: q=q-i s=s+1 else: break print(s, q)