N, K = map(int, input().split()) A = list(map(int, input().split())) A.sort() now = K ans = 0 i = 0 while i < N and now - A[i] >= 0: now -= A[i] i += 1 ans += 1 print(ans, now)