import numpy as np
N,X = map(int, input().split())
L = list(map(int, input().split()))

dist = np.zeros(N+1, dtype=int)
for i in range(N):
  dist[i+1] = dist[i] + L[i]

i = 0
count = 0
while dist[i] <= X:
  count += 1
  i += 1
  if i == N +1:
    break
print(count)
"""
dist = 0
count = 1
for i in range(N):
  if dist + L[i] <= X:
    count += 1
    dist += L[i]
print(count)
""" import numpy as np numpy 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 dist = np.zeros(N+1, dtype=int) dist np.zeros(N+1, dtype=int) np.zeros np zeros N+1 N 1 dtype=int dtype int for i in range(N):
  dist[i+1] = dist[i] + L[i] i range(N) range N dist[i+1] = dist[i] + L[i] dist[i+1] dist i+1 i 1 dist[i] + L[i] dist[i] dist i L[i] L i i = 0 i 0 count = 0 count 0 while dist[i] <= X:
  count += 1
  i += 1
  if i == N +1:
    break dist[i] <= X dist[i] dist i X count += 1 count 1 i += 1 i 1 if i == N +1:
    break i == N +1 i N +1 N 1 break print(count) print count """
dist = 0
count = 1
for i in range(N):
  if dist + L[i] <= X:
    count += 1
    dist += L[i]
print(count)
""" L = list(map(int, input().split())) list(map(int, input().split())) L N,X = map(int, input().split()) map(int, input().split()) N i += 1 1 i X = map(int, input().split()) map(int, input().split()) X i = 0 0 i count = 0 0 count count += 1 1 count dist = np.zeros(N+1, dtype=int) np.zeros(N+1, dtype=int) dist
import numpy as np
N,X = map(int, input().split())
L = list(map(int, input().split()))

dist = np.zeros(N+1, dtype=int)
for i in range(N):
  dist[i+1] = dist[i] + L[i]

i = 0
count = 0
while dist[i] <= X:
  count += 1
  i += 1
  if i == N +1:
    break
print(count)
"""
dist = 0
count = 1
for i in range(N):
  if dist + L[i] <= X:
    count += 1
    dist += L[i]
print(count)
"""