n, x = map(int, input().split())
a = list(map(int, input().split()))
count = 0

a.sort()
remain = 0

for i in range(len(a)):
    remain = x - a[i]
    if sum(a) == x:
        while n > 0:
            count += 1
            n -= 1
        continue
    if remain >= 0 and i != len(a)-1:
        count += 1
    else:
        break

print(count)