n, k = map(int, input().split()) aList = list(map(int, input().split())) aList.sort() sum = 0 nmax = 0 for i in range(n): if sum + aList[i] > k: break else: sum = sum + aList[i] nmax = nmax + 1 rest = k - sum print("%d %d" % (nmax, rest))