import sys def main(): sys.setrecursionlimit(100000) input = lambda: sys.stdin.readline()[:-1] N, K = map(int, input().split()) A = list(map(int, input().split())) A.sort() ans = 0 for ai in A: if K >= ai: ans += 1 K -= ai else: print(ans, K) break if not __debug__: f = open(sys.argv[1], "r") sys.stdin = f try: sys.set_int_max_str_digits(100000) except AttributeError: pass main()