program bounding
  implicit none
  integer :: n, x, ans, i, d
  integer,allocatable :: l(:)
  read *, n, x
  allocate(l(n))
  read *, l
  ans = 0
  d = 0
  do i = 1, n
    d = d + l(i)
    ans = ans + 1
    if (d > x) exit
    if (i == n) ans = ans + 1
  end do
  print '(i0)', ans
  stop
end program bounding
