n,k=map(int,input().split()) L=list(map(int,input().split())) L.sort() cnt=0 for e in L: if e<=k: k-=e cnt+=1 print(cnt,k)