program kadai
implicit none
integer  ::  n,x,i,ans,d
integer,allocatable  ::  l(:)

read(*,*) n,x
allocate(l(n))
read(*,*) l

ans=1
d=0
do i=1,n
    if(d+l(i)>x) then
        write(*,*) ans
        stop
    end if
    d=d+l(i)
    ans=ans+1
end do

end program kadai