def main():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    D = 0

    for cnt in range(2, N + 2):
        D += L[cnt - 2]
        if D > X:
            cnt -= 1
            break

    print(cnt)


if __name__ == "__main__":
    main() def main():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    D = 0

    for cnt in range(2, N + 2):
        D += L[cnt - 2]
        if D > X:
            cnt -= 1
            break

    print(cnt) main 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 for cnt in range(2, N + 2):
        D += L[cnt - 2]
        if D > X:
            cnt -= 1
            break

     cnt range(2, N + 2) range 2 N + 2 N 2 D += L[cnt - 2] D L[cnt - 2] L cnt - 2 cnt 2 if D > X:
            cnt -= 1
            break

     D > X D X cnt -= 1 cnt 1 break print(cnt) print cnt if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    D = 0

    for cnt in range(2, N + 2):
        D += L[cnt - 2]
        if D > X:
            cnt -= 1
            break

    print(cnt) def main():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    D = 0

    for cnt in range(2, N + 2):
        D += L[cnt - 2]
        if D > X:
            cnt -= 1
            break

    print(cnt) main
def main():
    N, X = map(int, input().split())
    L = list(map(int, input().split()))
    D = 0

    for cnt in range(2, N + 2):
        D += L[cnt - 2]
        if D > X:
            cnt -= 1
            break

    print(cnt)


if __name__ == "__main__":
    main()
