n, x = gets.split.map(&:to_i)
l = gets.split.map(&:to_i)

def dn(i, l)
  if i == 1
    0
  else
    dn(i - 1, l) + l[i - 2]
  end
end


1.upto(n + 1) do |i|
  d = dn(i, l)
  if d > x
    puts i - 1
    exit
  end
end