#!/user/bin/env ruby

N, X = gets.chomp.split.map(&:to_i)
array = gets.chomp.split.map(&:to_i)


coord = 0
counter = 0

array.each do |item|
  counter = counter + 1
  # p coord
  coord = coord + item
  break if coord > X
end


if coord <= X
  counter = counter + 1
end

# puts ""
puts counter
