import sys input = lambda :sys.stdin.readline()[:-1] def main(): N, K = map(int, input().split()) A = list(map(int, input().split())) i = 0 A.sort() while K>=0 and i < N: if K-A[i]>=0: K -= A[i] else: break i+=1 print(i, K) if __name__ == '__main__': main()