from bisect import bisect_right

n, x = map(int, input().split())
L = list(map(int, input().split()))
D = [0]
for i in range(n):
    D += [L[i] + D[i]]
ans = bisect_right(D, x)
print(ans) from bisect import bisect_right n, x = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split x L = list(map(int, input().split())) L list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split D = [0] D [0] 0 for i in range(n):
    D += [L[i] + D[i]] i range(n) range n D += [L[i] + D[i]] D [L[i] + D[i]] L[i] + D[i] L[i] L i D[i] D i ans = bisect_right(D, x) ans bisect_right(D, x) bisect_right D x print(ans) print ans n, x = map(int, input().split()) map(int, input().split()) n ans = bisect_right(D, x) bisect_right(D, x) ans D += [L[i] + D[i]] [L[i] + D[i]] D L = list(map(int, input().split())) list(map(int, input().split())) L x = map(int, input().split()) map(int, input().split()) x D = [0] [0] D
from bisect import bisect_right

n, x = map(int, input().split())
L = list(map(int, input().split()))
D = [0]
for i in range(n):
    D += [L[i] + D[i]]
ans = bisect_right(D, x)
print(ans)