N, K = map(int, input().split()) A = sorted(map(int, input().split())) ans = 0 for a in A: if a <= K: K -= a ans += 1 print(ans, K)