n, S = map(int, input().strip().split(" "))
c = list(map(int, input().strip().split(" ")))
c.sort()
ret = 0
for num in c:
    S -= num
    if S >= 0:
        ret += 1
    if S < 0:
        break
print(ret)
0c895d516217bf738c5f713f682259942d25d00b
<mask token>

<mask token>
c.sort()
<mask token>
for num in c:
    S -= num
    if S >= 0:
        ret += 1
    if S < 0:
        break
print(ret)

n, S = map(int, input().strip().split(' '))
c = list(map(int, input().strip().split(' ')))
c.sort()
ret = 0
for num in c:
    S -= num
    if S >= 0:
        ret += 1
    if S < 0:
        break
print(ret)

n, S = map(int, input().strip().split(" "))
c = list(map(int, input().strip().split(" ")))
c.sort()
ret = 0
for num in c:
    S -= num
    if S >= 0:
        ret += 1
    if S < 0:
        break
print(ret)