program bounding
  implicit none
  integer :: n, l(100), x, d, m, i
  l = 0
  read(*,*) n, x
  read(*,*) l(1:n)
  d = 0
  m = 0
  do
    m = m+1
    if (m.gt.n) exit
    d = d+l(m)
    if (d.gt.x) exit
  end do
  write(*,'(i0)') m
  stop
end program bounding