n, x = gets.strip.split(" ").map(&:to_i)
jumps = gets.strip.split.map(&:to_i)
now_place=0
places=[0]
jumps.each do |jump|
  now_place += jump
  places << now_place
end
puts places.select{|i|i<=x}.length
