N,X = gets.strip.split.map(&:to_i)
bounds = gets.strip.split.map(&:to_i)

state = []
state[0] = 0
count = 0

N.times do |i|
    state[i+1] = bounds[i] + count
    count = state[i+1]
end

result = 0

state.length.times do |m|
    if state[m] <= X
        result += 1
    end
end

puts result