a = gets.split
n = a[0].to_i
x = a[1].to_i
answer = 0

bound = []
t = 1

b = gets.split
bound[0] = 0
bound[1] = b[0]

n-2.times do
  bound[t+1] = b[t].to_i + bound[t].to_i
end

t = 0

n.times do
  if x - bound[t].to_i >= 0
    answer += 1
    t += 1
  end
end

puts answer