program main
	implicit none
    integer :: n, x, kaisu, sum, i
    integer, allocatable :: l(:)
    read(*, *) n, x
    allocate(l(n))
    read(*, *) (l(i), i = 1, n)
    kaisu = 0
    sum = 0
    do while (sum.le.x .and. kaisu.le.n)
		kaisu = kaisu + 1
    	sum = sum + l(kaisu)
    enddo
    write(*, *) kaisu
stop
end program main