integer N,X
integer location
integer ans
integer,allocatable,dimension(:)::L
read*,N,X
allocate(L(N+1))
L(1)=0
read*,L(2:N+1)

ans=0
location=0
do i=1,N+1
  location=location+L(i)
  if(location>X)exit
  ans=ans+1
end do

print"(i0)",ans

end