n, x = gets.strip.split.map(&:to_i)
ary = gets.strip.split(" ").map(&:to_i)
sum = 0
ans = []
pop = []
ary.each_with_index do |a, i|
  if i == 0
   ans << i
  else
    sum += a
    ans << sum
  end
end
ans.each do |k|
  if k <= x
    pop << k
  end
end
puts pop.count