peterverebics/CodeNet_Python_118 huggingface dataset:
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()
n, X = map(int, input().split())
l = list(map(int, input().split()))

sumList = [0]
for i in range(n):
    s = sumList[i]+l[i]
    if s > X:
        break
    sumList.append(s)

print(len(sumList))
import itertools

N, X = [int(_) for _ in input().split()]
L = [int(_) for _ in input().split()]

bounce_positions = list(itertools.accumulate([0]+L))
ans = sum(x <= X for x in bounce_positions)
print(ans)
n,x=map(int,input().split())
l=list(map(int,input().split()))

d=0
cnt=1

for i in range(1,n+1):
    d=d+l[i-1]
    if d<=x:
        cnt+=1

print(cnt)
N, X = map(int, input().split())
L = list(map(int, input().split()))
cnt = 1
total = 0
for i in range(N):
  total += L[i]
  if total <= X:
    cnt += 1
  else:
    break
print(cnt)
def cumsum(xs):
    result = [0,xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result
a,b=map(int,input().split())
c=list(map(int,input().split()))
n=cumsum(c)
ans=[]
for i in range(len(n)):
    if n[i]<=b:
        ans.append(n[i])
print(len(ans))
n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
d = [0]
for i in range(1, n+1):
    d.append(d[i - 1] + l[i - 1])

for i in range(len(d)):
    if d[i] <= x:
        count += 1

print(count)
n,x = map(int,input().split())
l = list(map(int,input().split()))
d , count = 0 , 0

for i in range(0,n):
    d += l[i]
    #print(d)
    if d<=x:
        count+=1
print(count+1)
N, X = map(int, input().split())
L = list(map(int, input().split()))

d = 0
ans = 1

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

print(ans)
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
p = 1
for i in range(n):
    d += l[i]
    if d <= x:
        p += 1
print(p)
n,x = map(int,input().split())
ls = list(map(int, input().split()))
d = 0
ans = 0
for l in ls:
  if d <= x:
    ans += 1
  d += l
if d <= x:
  ans += 1
  
print(ans)
n,x = map(int,input().split())
L = list(map(int,input().split()))

d = [0]*(n+1)
d[0] = 0
for i in range(1,n+1):
    d[i] = d[i-1] +L[i-1]

print(len([i for i in d if i<=x]))
import bisect

N, X = map(int, input().split())
l = list(map(int, input().split()))
d = [-1]*(N+1) #0-index #バウンドする位置を格納するリスト
d[0] = 0 #バウンドする初期値は0

for i in range(1, N+1):
    d[i] = d[i-1] + l[i-1]

#print(d)
#print('left:', bisect.bisect_left(d, X))
#print('right:', bisect.bisect_right(d, X))
print(bisect.bisect_right(d, X))
n,x=map(int,input().split())
l=list(map(int,input().split()))
fly=0
count=1
for i in range(100):
  fly+=l[i]
  if fly<=x:
    count+=1
  else:
    break
print(count)
n,x=map(int,input().split())
L=list(map(int,input().split()))
ans = 1
cnt = 0
for l in L:
  cnt += l
  if x >= cnt:
    ans += 1
print(ans)
from bisect import bisect_right
N, X = map(int, input().split())
L = list(map(int, input().split()))
s = [0] * (N+1)
for i in range(N):
	s[i+1] = s[i] + L[i]
pos = bisect_right(s, X)
print(pos)
import sys
read=sys.stdin.buffer.readline

N,X=map(int,read().split())
L=list(map(int,read().split()))

ans=1
res=0
for l in L:
    res+=l
    if res<=X:
        ans+=1
    else:
        break
print(ans)
import bisect
from itertools import accumulate
N, X = map(int, input().split())
L = list(map(int, input().split()))
Lsum = list(accumulate(L))
ind = bisect.bisect_right(Lsum, X)
print(ind+1)
#!/usr/bin/env python3

import sys

input = iter(sys.stdin.read().splitlines()).__next__

N, X = map(int, input().split())
L = list(map(int, input().split()))

P = [0]
for d in L:
   P.append(P[-1] + d)

res = len( [1 for x in P if x <= X] )
print(res)
n, x = map(int, input().split())
l = [int(s) for s in input().split()]

pos = 0
count = 1
for i in range(n):
    pos += l[i]
    if pos > x:
        break
    count += 1
print(count)
n, x = (int(i) for i in input().split())
list_l = [int(j) for j in input().split()]
tmp = 0
count = 0
for i in range(0, n + 1):
    if i == 0:
        pass
    else:
        tmp += list_l[i - 1]
        if tmp > x:
            break
    count += 1
print(count)
n,x=map(int,input().split())
#ls=[0]+[int(x) for i in input().split()]
ls=list(map(int,input().split()))

#d=[]
#d.append(0)
ans=0
d=0
for i in ls:
	d=d+i
	if d>x:
		break
	ans +=1
	
print(ans+1)
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=0
k=0
for i in range(n):
    k+=l[i]
    if k<=x:
        ans+=1
print(ans+1)
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 bisect
n,x=map(int,input().split())
L=list(map(int,input().split()))
lst=[0]*(n+1)
for i in range(1, n+1):
  lst[i]=lst[i-1]+L[i-1]
print(bisect.bisect_right(lst,x))
n,x = map(int,input().split())
l = list(map(int,input().split()))
count = 1
x1 = 0
for i in range(n):
  if x1 + l[i] <= x:
    count += 1
    x1 += l[i]
  else:
    print(count)
    exit()
print(count)
n,x = map(int,input().split())
li = list(map(int,input().split()))
cnt = 0
num = 1
for i in li:
    if cnt + i > x:
        break
    else:
        cnt += i
        num += 1
print(num)
n,x=map(int,input().split())
L=[int(_) for _ in input().split()]
S_L=[0]
count=1
for i in range(n):
    S_L.append(S_L[-1]+L[i])
    if S_L[-1]<=x:
        count+=1
    else:
        print(count)
        break
else:print(n+1)
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]


n,x = map(int, input().split())
l = list(map(int, input().split()))

temp = []

temp.append(0)
last = 0
for i in range(n):
    temp.append(last+l[i])
    last += l[i]
ans = 0
for i in range(n+1):
    if temp[i] <= x:
        ans += 1
print(ans)
n, x = [int(i) for i in input().split()]
l = [0] + [int(i) for i in input().split()]
total = 0
cnt = 0
for i in l:
	total += i
	if total <= x:
		cnt += 1
	else:
		break
print(cnt)
N,X=map(int,input().split())
L=[int(i) for i in input().split()]
count=1
dis=0
for t in L:
    dis=dis+t
    if dis<=X:
        count+=1
    else:
        break
print(count)
n, x = map(int, input().split())
l = list(map(int, input().split()))
ans = 1
p = 0
for i in range(n):
    p += l[i]
    if p <= x:
        ans += 1
    
print(ans)
n, x = map(int, input().split())
L = list(map(int, input().split()))

point = 0
ans = 1

for l in L:
    point += l
    if point > x:
        break
    ans += 1

print(ans)
N, X = map(int,input().split())
L = list(map(int,input().split()))
cnt = 0
D = [0]
for i in range(N):
  D.append(D[i]+L[i])
l = [d for d in D if d <= X]
print(len(l))
n,x=map(int,input().split())
l=list(map(int,input().split()))
b=0
cnt=0
for i in l:
  b+=i
  cnt+=1
  if b>x:
    print(cnt)
    exit()
print(n+1)
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=0
ans=1
i=0
for i in range(n):
  d+=l[i]
  if d<=x:
    
    ans+=1
    #print(d)
  else:
    break
  
print(ans)
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
c = 1
for i in range(1, n + 1):
    d += l[i - 1]
    if d <= x:
        c += 1
    else:
        break
print(c)
n,x = map(int,input().split())
l = list(map(int,input().split()))
n,c = 0,1
for i in l:
    n+=i
    if(n<=x): c+=1
    else: break
print(c)
N,X=map(int,input().split())
L=list(map(int,input().split()))
l=[0]
s=0
for i in range(N):
   s+=L[i]
   if  s>X:
       break
   l.append(s)
print(len(l))
N, X = list(map(int, input().split()))
L = list(map(int, input().split()))
 
D = 0
a = 1
for i in range(N):
    D = D + L[i]
    if D <= X:
        a += 1
    else:
        break
print(a)
n,x=map(int,input().split())
l=list(map(int,input().split()))
D=0
y=1
if x==0:
    print(1)
else:
    for i in range(n):
        D+=l[i]
        if D<=x:
            y+=1
    print(y)
n, x = list(map(int, input().split()))
l = list(map(int, input().split()))
c, p = 0, 0
while c < n:
    if p + l[c] <= x:
        p += l[c]
        c += 1
    else:
        break
print(c + 1)
n,x = map(int,input().split())
li = list(map(int,input().split()))

dist = 0

for i,d in enumerate(li,2):
  dist += d
  if dist > x:
    i -= 1
    break

print(i)
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

N,X = MI()
L = LI()

a = 0
ans = 1
for i in range(N):
    a += L[i]
    if a <= X:
        ans += 1

print(ans)
def main():
    from itertools import takewhile

    N, X = map(int, input().split())
    *L, = map(int, input().split())

    def accumulate(a):
        s = 0
        yield s
        for x in L:
            s += x
            yield s

    ans = len(tuple(takewhile(lambda s: s <= X, accumulate(L))))

    print(ans)


if __name__ == '__main__':
    main()
n, x = map(int, input().split())
l = [int(i) for i in input().split()]
p = 0
for i in range(n):
    p += l[i]
    if p > x:
        print(i + 1)
        break
else:
    print(n + 1)
N,X = map(int, input().split())
l = list(map(int,input().split()))
count = 1
d = 0
for i in range(N):
  d = d + l[i]
  if d <= X:
    count += 1
print(count)
a,b=map(int,input().split())
arr=list(map(int,input().split()))
c=1
s=0
for i in range(a):
	s+=arr[i]
	if s<=b:
		c+=1
	else:
		break	
		
print(c)
N,X = map(int,input().split())
L = list(map(int,input().split()))
counter = 1
total = 0
for l in L:
    total+=l
    if(total <=X):counter+=1

print(counter)
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]
for i in range(1,n+1):
    d.append(d[i-1]+l[i-1])

ans = 0

for dd in d:
    if dd <= x:
        ans += 1
print(ans)
N, X = map(int, input().split())
L = list(map(int, input().split()))
d = 0
count = 0
for i in range(N):
  d += L[i]
  if X < d:
    count = i + 1
    break
if count == 0:
  print(N + 1)
else:
  print(count)
N,X = map(int,input().split())
L =[0] + list(map(int,input().split()))

D = [0 for i in range(N+2)]
cnt = 1
for i in range(2,N+2):
  D[i] = D[i-1] + L[i-1]
  if D[i] > X:
    break
  else:  
    cnt += 1
print(cnt)
numList1 = list(map(int, input().split()))
numList2 = list(map(int, input().split()))
add = 0
result = 1
cood = []
for i in range(0, len(numList2)):
    add += numList2[i]
    cood.append(add)
for i in cood:
    if i <= numList1[1]:
        result += 1
    else:
        continue
print(result)
def solve():
    N,X = map(int,input().split())
    L = list(map(int, input().split()))
    D = 0
    count = 1
    for i in range(N):
        D += L[i]
        count += 1 if D <= X else 0

    print(count)

if __name__ == '__main__':
    solve()
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    N,X=map(int,readline().split())
    L=list(map(int,readline().split()))

    S=[0]*(N+1)
    for i in range(1,N+1):
        S[i]+=S[i-1]+L[i-1]
    res=0
    for i in range(N+1):
        if S[i]<=X:
            res+=1
        else:
            break
    print(res)
if __name__=="__main__":
    main()
n, x = map(int, input().split())
a = [ int(x) for x in input().split() ]
cnt = 1
s = 0
for aa in a:
    s += aa
    if s <= x:
        cnt += 1

print(cnt)
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = [0]
for i in range(1, n+1):
    d.append(d[i-1]+l[i-1])
cnt = 0
for j in d:
    if j <= x:
        cnt += 1
print(cnt)
N, X = map(int, input().split())
L = list(map(int, input().split()))

ans = 1
d = 0
for x in L:
    d = d + x
    if d <= X :
        ans += 1

print(ans)
N,X = map(int, input().split())
L = list(map(int, input().split()))

cnt=1
d=0
for i in range(N):
    if d+L[i]<=X:
        cnt+=1
        d=d+L[i]
    else:
        break
print(cnt)
n,x = map(int,input().split())
L = list(map(int,input().split()))
ans = 1
l = 0

for i in range(n):
    l += L[i]
    if l <= x:
        ans += 1
        
print(ans)
from itertools import accumulate

n, x = map(int, input().split())
L = list(map(int, input().split()))
C = [0] + list(accumulate(L))
#print(C)

cnt = 0
for c in C:
    if c <= x:
        cnt += 1
print(cnt)
n, x = map(int, input().split())
L = list(map(int, input().split()))
val = 0
count = 1

for l in L:
    val += l
    if val <= x:
        count += 1
print(count)
#!/usr/bin/env python3
# https://atcoder.jp/contests/abc130/tasks/abc130_b

n, x = [int(x) for x in input().split()]
li = [int(x) for x in input().split()]
li2 = [0] + [sum(li[:i + 1]) for i, n in enumerate(li)]
li2 = [n for n in li2 if n <= x]
print(len(li2))
n,x = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
count = 1
for i in range(n):
  ans = ans + l[i]
  if ans > x:
    break
  count += 1
print(count)
n,x=map(int,input().split())
l=list(map(int,input().split()))
tmp=0
ans=1
for i in range(n):
    tmp+=l[i]
    if tmp<=x:
        ans+=1
print(ans)
from bisect import bisect_right
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = [0]
for i in range(1, n+1):
   d.append(d[i-1]+l[i-1])
cnt = bisect_right(d, x)
print(cnt)
import sys
input = sys.stdin.readline
N, X = map(int, input().split())
a = list(map(int, input().split()))
cs = [0] * (N + 1)
for i in range(N): cs[i + 1] = cs[i] + a[i]
res = N + 1
for i in range(N + 1):
  if cs[i] > X:
    res = i
    break
print(res)
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = 0
count = 1
for i in range(n):
    d += l[i]
    if d <= x:
      count += 1
    else:
      print(count)
      exit()
print(count)
n, x = map(int, input().split())
a = list(map(int, input().split()))
l = [0] * (n+1)
for i in range(n):
  l[i+1] = l[i] + a[i]
ans = 0
for i in l:
  if i <= x:
    ans += 1
print(ans)
N, X = map(int, input().split())
L = list(map(int, input().split()))
z = 0
L.insert(0,0)
for i in range(len(L)):
  bound = i+1
  z += L[i]
  if z > X:
    bound -= 1
    break
print(bound)
N, X = map(int, input().split())
L = list(map(int, input().split()))

D = 0
num = 1

while num <= N:
  D = D + L[num-1]
  if D > X:
    print(num)
    break
  num += 1
else:
  print(N+1)
n, x = map(int, input().split())
l = list(map(int, input().split()))

cnt = 1
position = 0

for i in range(n):
    position += l[i]
    if position <= x:
            cnt += 1
    else:
            break
print(cnt)
n,x=map(int,input().split())
l=list(map(int,input().split()))
cnt=1
d=0
for i in range(n):
    d+=l[i]
    if d<=x:
        cnt+=1
print(cnt)
N,X = map(int,input().split())
L = list(map(int,input().split()))
ans = 1

for i in range(N):
    if sum(L[:i+1]) <= X:
        ans += 1
    else:
        break
    
print(ans)
arr1 = input().split()
n,x = int(arr1[0]),int(arr1[1])

arr2 = input().split()

d = 0
count = 1
for i in range(1, n + 1):
  d += int(arr2[i-1])
  if d <= x:
    count +=1
    
print(count)
n, x = map(int, input().split())
l = list(int(i) for i in input().split())
d = 0
cnt = 1
for i in range(n):
    d += l[i]
    if d <= x:
        cnt += 1
print(cnt)
n,x=map(int,input().split())
Len=[int(i) for i in input().split()]

ans=n+1
test=0
for i in range(n):
  test+=Len[i]
  if test<=x:
    continue
  else:
    ans=i+1
    break
    
print(ans)
n,x = map(int,input().split())
L = list(map(int,input().split()))

s = 0
for i in range(n):
    s += L[i]
    if s > x:
        print(i+1)
        break
else:
    print(n+1)
N,X=map(int,input().split())
L=list(map(int,input().split()))
c=1
tmp=0
for i in range(N):
  tmp += L[i]
  if tmp <=X:
    c+=1

print(c)
N,X = map(int,input().split())
L = list(map(int,input().split()))
count = 1
s = 0
for i in range(N):
    s += L[i]
    if s <= X:
        count += 1
print(count)
N, X = map(int, input().split())
Ls = [int(i) for i in input().split()]

Ds = [0]
for i, l in enumerate(Ls):
    Ds.append(Ds[i] + l)

print(sum([d <= X for d in Ds]))
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n, x = map(int, input().split())
    l = tuple(map(int, input().split()))

    d = 0
    for i in range(1, n+1):
        d += l[i-1]
        if d > x:
            print(i)
            quit()
    else:
        print(n+1)

if __name__ == '__main__':
    main()
from itertools import accumulate
n,x = map(int, input().split())
a = [0] + list(map(int, input().split()))
print(len([i for i in accumulate(a) if i < x+1]))
import itertools
import bisect

N, X = map(int, input().split())
*L, = map(int, input().split())

A = list(itertools.accumulate(L))
print(bisect.bisect(A, X) + 1)
inputted = list(map(int, input().split()))
N = inputted[0]
X = inputted[1]
L = list(map(int, input().split()))

x = 0
number_of_bounds = 0
for _i, Li in enumerate(L):
    number_of_bounds = _i + 1
    x += Li
    if x > X: break

if x <= X:
    number_of_bounds += 1

print(number_of_bounds)
x = list(map(int, input().split()))[1]
l = list(map(int, input().split()))
m = [0]
for i in l:
    if i+m[-1] <= x:
        m.append(i+m[-1])
    else:
        break
print(len(m))
n, x = map(int, input().split())
l = list(map(int, input().split()))

d = [0] * (n+1)
ans = 1
for i in range(1, n+1):
    d[i] = d[i-1] + l[i-1]
    if d[i] <= x:
        ans += 1

print(ans)
N, X = map(int, input().split())
L = list(map(int, input().split()))

tmp = 0
count = 0
for l in L:
    if tmp <= X:
        count += 1
    tmp += l

if tmp <= X:
    count += 1

print (count)
n, x = list(map(int, input().split()))
# a = list(map(int, input().split()))
# data = [list(map(int, input().split())) for i in range(n)]
# k = int(input())
L = list(map(int, input().split()))
# ab_sorted = sorted(ab, key=lambda x: x[0])
#ab = [list(map(int, input().split())) for i in range(n)]
# print(min(15*n, 100*(n//10+1), 100*(n//10)+15*(n % 10)))
d = 0
count = 1
for l in L:
    if d+l > x:
        break
    else:
        d = d+l
        count += 1

print(count)
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
e = 1
for i in l:
  d = d + i
  if d  <= x:
    e += 1
print(e)
n, x = map(int, input().split())
l = list(map(int, input().split()))

cum = [0] * (n+1)
for i in range(1, n+1):
    cum[i] = cum[i-1] + l[i-1]

f = True
for i in range(n+1):
    if cum[i] > x:
        f = False
        print(i)
        break
if f:
    print(n+1)
n,x=map(int,input().split())
l=list(map(int,input().split()))
list=[0]
cnt=0
for i in l:
  i=i+list[cnt]
  list.append(i)
  cnt+=1
ans=0
for i in list:
  if i<=x:
    ans+=1
print(ans)
N,X = map(int,input().split())
L = list(map(int,input().split()))
tmp = 0
for i in range(N):
  tmp = tmp + L.pop(0)
  if(tmp == X):
    print(str(i + 2))
    exit()
  elif(tmp > X):
    print(str(i + 1))
    exit()
  else:
    pass
if(i + 1 == N):
  print(str(N + 1))
import sys
input = sys.stdin.readline
N, X = map(int, input().split())
A = list(map(int, input().split()))
B = [0]
cnt = 0

for i in range(N):
  B.append(B[i]+A[i])

for i in range(len(B)):
  if B[i] <= X:
    cnt += 1

print(cnt)
n,x = map(int,raw_input().split())
l = map(int,raw_input().split())
d1=0
bou = 1
for i in xrange(n):
    d1 += l[i]
    
     
    if d1 > x:
        break
    else:
        bou += 1
print bou
N,X = map(int,input().split())
L_li = input().split()
for i in range(len(L_li)):
    L_li[i] = int(L_li[i])

D = [0]*(N+1)
for i in range(1,N+1,1):
    D[i] = D[i-1] + L_li[i-1]
print(len([i for i in D if i <= X]))
N,X = map(int,input().split())
l = list(map(int,input().split()))

pos = 0
cnt = 1

for i in range(N):
    pos += l[i]

    if pos <= X:
        cnt += 1
    else:
        break

print(cnt)
n,x=map(int,input().split())
a=list(map(int,input().split()))
cnt=1
now=0
if sum(a)<=x:
    print(n+1)
    exit()
for i in a:
    now+=i
    if now>x:
        print(cnt)
        exit()
    cnt+=1
n, x = map(int, input().split())
l = list(map(int, input().split()))

ans = 1
d = 0
for i in range(n):
    d += l[i]
    if d <= x:
        ans += 1
print(ans)
import numpy as np

n, x = [int(_) for _ in input().split()]
l = np.cumsum(np.array([int(_) for _ in input().split()]))
print(sum([i <= x for i in l])+1)
n,x = map(int,input().split())
l = list(map(int,input().split()))
count = 0
d = [0]

for i in range(1,len(l)+1):
    d.append(l[i-1]+d[i-1])

for i in range(len(d)):
    if d[i] <= x:
        count += 1

print(count)
n, x = map(int, input().split())
Ls = list(map(int, input().split()))
ans = 1
target = 0
for l in Ls:
  target += l
  if target <= x:
    ans += 1
  else:
    print(ans)
    exit()
print(ans)
n,x = map(int,input().split())
l = list(map(int,input().split()))

lis = [0]
for i in range(n):
    lis.append(lis[i]+l[i])

print(sum(1 for li in lis if li <= x ))
n, x = map(int, input().split())
l = [int(i) for i in input().split()]
d = 0
count = 1
for li in l:
    d += li
    if d <= x:
        count += 1
print(count)
n,x = map(int,input().split())
l = list(map(int,input().split()))
dist = [0]*(n+1)
for i in range(1,n+1):
    dist[i] = dist[i-1] + l[i-1]
    
cnt = 0
for i in range(n+1):
    if dist[i]<= x:
        cnt += 1
print(cnt)
n, x = map(int, input().split())
L = list(map(int, input().split()))
dist = 0
res = 0
for i, l in enumerate(L, 1):
    dist += l
    if dist > x:
        print(i)
        exit()
    elif dist == x:
        print(i + 1)
        exit()
print(n + 1)
n, x = map(int, input().split())
a = list(map(int, input().split()))
s = 0
t = 1
for i in range(n):
  s = s + a[i]
  if s <= x:
    t += 1
print(t)
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = 0
count=1
for i in range(n):
  d += l[i]
  if d<=x:
    count+=1
print(count)
N,X=map(int,input().split())

arr=list(map(int,input().split()))
a=0
ans=1

for i in range(N):
    a=a+arr[i]
    if a<=X:
        ans+=1
        
print(ans)
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

# import numpy as np
import itertools

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, X, *L = map(int, read().split())

Lcum = itertools.accumulate(L)

answer = sum(i <= X for i in Lcum)
print(answer + 1)
n, x = map(int, input().split())
l = list(map(int, input().split()))
count = 1
point = 0

for i in range(n):
  point += l[i]
  if point <= x:
    count += 1
  else:
    break

print(count)
n,x = map(int,input().split())
l = list(map(int, input().split()))

ans = 1
tmp = 0
for i in l:
    tmp += i
    if(tmp > x):
        break
    ans += 1
print(ans)
n, x = map(int, input().split())
l = list(map(int, input().split()))
L = [0]
a = 0;b = 0
for i in l:
    a += i
    L.append(a)
for j in L:
    if j<=x:
        b += 1
print(b)
N, X = map(int, input().split())
L = list(map(int ,input().split()))
D = 0
ans = 1

for i in range(N):
    D += L[i]
    if D > X:
        break
    ans += 1

print(ans)
n,x=map(int,input().split())
l=list(map(int,input().split()))
sumd=0
for i in range(n):
  sumd+=l[i]
  if sumd>x:
    print(i+1)
    exit()
print(i+2)
# -*- coding: utf-8 -*-

def main():

    N, X = map(int, input().split())
    L = list(map(int, input().split()))

    D = 0
    ans = 0

    if D <= X:
        ans += 1

    for i in L:
        D += i
        if D <= X:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N, X = I()
L = [0] + l()
l = list(itertools.accumulate(L))

for i in l:
    if i <= X:
        count += 1

print(count)
n,x = map(int,input().split())
l = list(map(int, input().split()))

d = 0
ans = 1
for i in range(n):
    d = d + l[i]
    if d <= x :
         ans +=1
    else:
        break
print(ans)