program main
implicit none
integer :: n, x
integer , allocatable :: l(:)
integer :: i, nc, j

read(*,*) n, x
allocate( l(n))
read(*,*) l(:)
j = 0
nc = 1
do i = 1, n
   j = j+l(i)
   if( j .le. x ) then
      nc = nc + 1
   end if
end do
write(*,'(i0)') nc



end program main
