n, k = map(int, input().split()) la = list(map(int, input().split())) la.sort() ans = 0 for i in la: if k - i < 0: break ans += 1 k -= i print(ans, k)