N, X = gets.chomp.split(' ').map(&:to_i)
L = gets.chomp.split(' ').map(&:to_i)[0..N]

times = 1
L.reduce(0) do |sum, step|
  sum += step
  if sum > X
    puts times
    break
  end
  times = times + 1
  sum
end

puts times
