from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n, x = map(int, input().split())
    l = list(map(int, input().split()))

    ans = 1
    d = 0
    for li in l:
        if d + li <= x:
            ans += 1
            d += li
        else:
            break
    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main() from sys import stdin, setrecursionlimit def main():
    input = stdin.buffer.readline
    n, x = map(int, input().split())
    l = list(map(int, input().split()))

    ans = 1
    d = 0
    for li in l:
        if d + li <= x:
            ans += 1
            d += li
        else:
            break
    print(ans) main input = stdin.buffer.readline input stdin.buffer.readline stdin.buffer stdin buffer readline 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 ans = 1 ans 1 d = 0 d 0 for li in l:
        if d + li <= x:
            ans += 1
            d += li
        else:
            break
     li l if d + li <= x:
            ans += 1
            d += li
        else:
            break
     d + li <= x d + li d li x ans += 1 ans 1 d += li d li break print(ans) print ans if __name__ == "__main__":
    setrecursionlimit(10000)
    main() __name__ == "__main__" __name__ "__main__" setrecursionlimit(10000) setrecursionlimit 10000 main() main def main():
    input = stdin.buffer.readline
    n, x = map(int, input().split())
    l = list(map(int, input().split()))

    ans = 1
    d = 0
    for li in l:
        if d + li <= x:
            ans += 1
            d += li
        else:
            break
    print(ans) def main():
    input = stdin.buffer.readline
    n, x = map(int, input().split())
    l = list(map(int, input().split()))

    ans = 1
    d = 0
    for li in l:
        if d + li <= x:
            ans += 1
            d += li
        else:
            break
    print(ans) main
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n, x = map(int, input().split())
    l = list(map(int, input().split()))

    ans = 1
    d = 0
    for li in l:
        if d + li <= x:
            ans += 1
            d += li
        else:
            break
    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
