lands_cnt, drugs_cnt = map(int,input().split()) lands_list = [*map(int,input().split())] sorted_lands_list =sorted(lands_list) withered_lands_cnt = 0 for i in sorted_lands_list: if drugs_cnt >= i: drugs_cnt -= i withered_lands_cnt += 1 print(withered_lands_cnt, drugs_cnt)