n, x = gets.chomp.split(' ').map(&:to_i)
ls = gets.chomp.split(' ').map(&:to_i)

counter = 0
sum = 0

ls.each do |el|
  break if sum > x
  counter += 1
  sum += el
end

counter += 1 if sum <= x

puts counter