import sys
import itertools
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n,x = IL()
    l = [0]+list(IL())
    l = list(itertools.accumulate(l))
    ans = 0
    for rep in l:
        if x<rep:   break
        ans += 1
    print(ans)
    return

if __name__=='__main__':
    Main() import sys sys import itertools itertools def IL(): return map(int,sys.stdin.readline().rstrip().split()) IL def Main():
    n,x = IL()
    l = [0]+list(IL())
    l = list(itertools.accumulate(l))
    ans = 0
    for rep in l:
        if x<rep:   break
        ans += 1
    print(ans)
    return Main n,x = IL() n IL() IL x l = [0]+list(IL()) l [0]+list(IL()) [0] 0 list(IL()) list IL() IL l = list(itertools.accumulate(l)) l list(itertools.accumulate(l)) list itertools.accumulate(l) itertools.accumulate itertools accumulate l ans = 0 ans 0 for rep in l:
        if x<rep:   break
        ans += 1
     rep l if x<rep:   break
         x<rep x rep ans += 1 ans 1 print(ans) print ans return if __name__=='__main__':
    Main() __name__=='__main__' __name__ '__main__' Main() Main def Main():
    n,x = IL()
    l = [0]+list(IL())
    l = list(itertools.accumulate(l))
    ans = 0
    for rep in l:
        if x<rep:   break
        ans += 1
    print(ans)
    return def Main():
    n,x = IL()
    l = [0]+list(IL())
    l = list(itertools.accumulate(l))
    ans = 0
    for rep in l:
        if x<rep:   break
        ans += 1
    print(ans)
    return Main def IL(): return map(int,sys.stdin.readline().rstrip().split()) def IL(): return map(int,sys.stdin.readline().rstrip().split()) IL
import sys
import itertools
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n,x = IL()
    l = [0]+list(IL())
    l = list(itertools.accumulate(l))
    ans = 0
    for rep in l:
        if x<rep:   break
        ans += 1
    print(ans)
    return

if __name__=='__main__':
    Main()