
url = "https://atcoder.jp//contests/abc130/tasks/abc130_b"

def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    lis.insert(0, 0)
    count = 0
    pos = 0
    for l in lis:
        pos += l
        count += 1
        if pos > x:
            print(count-1)
            exit()
    print(count)

if __name__ == '__main__':
    main() url = "https://atcoder.jp//contests/abc130/tasks/abc130_b" url "https://atcoder.jp//contests/abc130/tasks/abc130_b" def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    lis.insert(0, 0)
    count = 0
    pos = 0
    for l in lis:
        pos += l
        count += 1
        if pos > x:
            print(count-1)
            exit()
    print(count) main n,x = list(map(int, input().split())) n list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split x lis = list(map(int, input().split())) lis list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split lis.insert(0, 0) lis.insert lis insert 0 0 count = 0 count 0 pos = 0 pos 0 for l in lis:
        pos += l
        count += 1
        if pos > x:
            print(count-1)
            exit()
     l lis pos += l pos l count += 1 count 1 if pos > x:
            print(count-1)
            exit()
     pos > x pos x print(count-1) print count-1 count 1 exit() exit print(count) print count if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main url = "https://atcoder.jp//contests/abc130/tasks/abc130_b" "https://atcoder.jp//contests/abc130/tasks/abc130_b" url def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    lis.insert(0, 0)
    count = 0
    pos = 0
    for l in lis:
        pos += l
        count += 1
        if pos > x:
            print(count-1)
            exit()
    print(count) def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    lis.insert(0, 0)
    count = 0
    pos = 0
    for l in lis:
        pos += l
        count += 1
        if pos > x:
            print(count-1)
            exit()
    print(count) main

url = "https://atcoder.jp//contests/abc130/tasks/abc130_b"

def main():
    n,x = list(map(int, input().split()))
    lis = list(map(int, input().split()))
    lis.insert(0, 0)
    count = 0
    pos = 0
    for l in lis:
        pos += l
        count += 1
        if pos > x:
            print(count-1)
            exit()
    print(count)

if __name__ == '__main__':
    main()
