a,b=map(int,input().split()) x=sorted(list(map(int,input().split()))) ans=0 for c in x : if c <= b: b-=c ans+=1 print(ans,b)