N,x = map(int,input().split())


i = 0
while i < N :
    li = list(map(int,input().split()))
    i += 1


j = 0
k = 0
while k < N:
    if x > li[k]:
        j += 1
        x = x - li[k]
        k += 1
    else:
        x = x - li[k]
        k += 1


print(str(j))

