n, k = map(int, input().split()) A = list(map(int, input().split())) A.sort() ans = 0 for a in A: if k >= a: k -= a ans += 1 print(ans, k)