n, k = map(int, input().split()) a = list(map(int, input().split())) a.sort() cnt = 0 for i in range(n): if k < a[i]: break cnt += 1 k -= a[i] print(cnt, k)