N, X = gets.chomp.split(' ').map(&:to_i)
L = gets.chomp.split(' ').map(&:to_i)
puts N.times.reduce(0) do |dist, i|
  new_dist = dist + L[i]
  if new_dist > X
    puts i.succ
    exit
  end
  dist + L[i]
end