N,X = gets.chomp.split(" ").map(&:to_i)
arr = gets.chomp.split(" ").map(&:to_i)

bound = 0
cnt = 0
arr.unshift 0
arr.each do |l|
    bound +=l
    if bound <= X
        cnt +=1
    else
        break
    end
    
end

puts cnt