#!/usr/bin/ruby
#encoding: utf-8

#input 
n,x = gets.split.map(&:to_i)
L_kari = gets.split.map(&:to_i)

L = Array.new(n+1,-1)
(1..n).each do |i|
  L[i] = L_kari[i-1]
end

d = Array.new(n+2,-1)

d[1] = 0
(2..n+1).each do |i|
  d[i] = d[i-1] + L[i-1]
end

cnt = 0
(1..n+1).each do |i|
  if d[i] <= x then 
    cnt += 1
  end
end

puts cnt
