N, K = map(int, input().split(' ')) A = list(map(int, input().split(' '))) A = sorted(A) cnt = 0 while True: if len(A) == 0: break if A[0] > K: break K -= A.pop(0) cnt += 1 print(f'{cnt} {K}')