program main
  implicit none
  integer :: n, i, d, x, res
  integer, allocatable :: l(:)
  read (*, *) n, x
  allocate (l(n))
  read (*, *) l(:)
  d = 0
  res = 1
  do i = 1, n
    d = d + l(i)
    if (d <= x) res = res + 1
  end do
  write (*, "(i0)") res
end program main

