import scala.io.StdIn


object Main extends App {
  val Array(n, x)  = StdIn.readLine.split(" ").map(_.toInt)
  val l :Array[Int] = StdIn.readLine.split(" ").map(_.toInt)

  def solve(n: Int, a: Int, l: Array[Int]) : Int  = {
    l.zipWithIndex.foldLeft(0) {(acc, v) =>
      if (acc + v._1 <= x) acc + v._1 else return v._2 + 1

    }
    l.length + 1
  }
  println(solve(n, x, l))

}
  

