in1=gets.chomp.split(" ").map(&:to_i)
in2=gets.chomp.split(" ").map(&:to_i)
n=in1[0]
x=in1[1]
array=[]
pos=0
count=0
for i in 0..n do #座標の配列を用意
 array.push(pos)
 if i<n
  pos=pos+in2[i]
 end
end
for j in 0...array.size do
 if array[j]<=x #何回跳ねるかカウント
  count=count+1
 end
end
puts count