attrs = Array.new
while line = $stdin.gets
    attrs << line.chomp.split.map{|v| v.to_i }
end

tmp = attrs.shift
N = tmp[0]
X = tmp[1]
L = attrs.shift

bound = 1
d = 0
L.each{|n|
  d += n
  bound += 1 if d <= X
}
puts bound