n, k = map(int, input().split()) A = list(map(int, input().split())) A.sort() ANS = [0, k] for i in range(n): if ANS[1] > A[i]: ANS[0] += 1 ANS[1] -= A[i] else: break print(*ANS)