n,x = gets.chomp.split(' ').map(&:to_i)
l = gets.chomp.split(' ').map(&:to_i)
current = 0
count = 0
l.each do |num|
  if (current <= x)
    count += 1
  end
  current += num
end
if (current <= x)
  count += 1
end
puts count