import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    lsum = [0 for _ in range(N + 1)]
    for i in range(N):
        lsum[i + 1] = L[i] + lsum[i]

    for i in range(N + 1):
        if lsum[i] <= X:
            ans = i + 1
        else:
            break
    print(ans)


if __name__ == '__main__':
    solve() import sys sys input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def solve():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    lsum = [0 for _ in range(N + 1)]
    for i in range(N):
        lsum[i + 1] = L[i] + lsum[i]

    for i in range(N + 1):
        if lsum[i] <= X:
            ans = i + 1
        else:
            break
    print(ans) solve 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 0 for _ in range(N + 1) for _ in range(N + 1) _ range(N + 1) range N + 1 N 1 for _ in range(N + 1) 0 lsum = [0 for _ in range(N + 1)] lsum [0 for _ in range(N + 1)] for i in range(N):
        lsum[i + 1] = L[i] + lsum[i]

     i range(N) range N lsum[i + 1] = L[i] + lsum[i] lsum[i + 1] lsum i + 1 i 1 L[i] + lsum[i] L[i] L i lsum[i] lsum i for i in range(N + 1):
        if lsum[i] <= X:
            ans = i + 1
        else:
            break
     i range(N + 1) range N + 1 N 1 if lsum[i] <= X:
            ans = i + 1
        else:
            break
     lsum[i] <= X lsum[i] lsum i X ans = i + 1 ans i + 1 i 1 break print(ans) print ans if __name__ == '__main__':
    solve() __name__ == '__main__' __name__ '__main__' solve() solve def solve():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    lsum = [0 for _ in range(N + 1)]
    for i in range(N):
        lsum[i + 1] = L[i] + lsum[i]

    for i in range(N + 1):
        if lsum[i] <= X:
            ans = i + 1
        else:
            break
    print(ans) def solve():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    lsum = [0 for _ in range(N + 1)]
    for i in range(N):
        lsum[i + 1] = L[i] + lsum[i]

    for i in range(N + 1):
        if lsum[i] <= X:
            ans = i + 1
        else:
            break
    print(ans) solve input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    lsum = [0 for _ in range(N + 1)]
    for i in range(N):
        lsum[i + 1] = L[i] + lsum[i]

    for i in range(N + 1):
        if lsum[i] <= X:
            ans = i + 1
        else:
            break
    print(ans)


if __name__ == '__main__':
    solve()
