n, x = (int(i) for i in input().split())

l = [0] + [int(i) for i in input().split()]



d = 0

ans = 0

i = 1

while d <= x:

    ans += 1

    if ans == n+1:

        break

    d = d + l[i]

    i += 1



print(ans)
def main():

    N, X = (int(i) for i in input().split())

    L = [int(i) for i in input().split()]

    from itertools import accumulate

    S = accumulate([0] + L)

    print((len([e for e in S if e <= X])))





if __name__ == '__main__':

    main()

n, x = (int(i) for i in input().split())
l = [0] + [int(i) for i in input().split()]
d = 0
ans = 0
i = 1
while d <= x:
    ans += 1
    if ans == n + 1:
        break
    d = d + l[i]
    i += 1
print(ans)

def main():
    N, X = (int(i) for i in input().split())
    L = [int(i) for i in input().split()]
    from itertools import accumulate

    S = accumulate([0] + L)
    print((len([e for e in S if e <= X])))


if __name__ == "__main__":
    main()

-n, x = (int(i) for i in input().split()) -l = [0] + [int(i) for i in input().split()] -d = 0 -ans = 0 -i = 1 -while d <= x: -    ans += 1 -    if ans == n + 1: -        break -    d = d + l[i] -    i += 1 -print(ans) +def main(): +    N, X = (int(i) for i in input().split()) +    L = [int(i) for i in input().split()] +    from itertools import accumulate + +    S = accumulate([0] + L) +    print((len([e for e in S if e <= X]))) + + +if __name__ == "__main__": +    main()