import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val x = sc.nextInt
  val ls = Seq.fill(n)(sc.nextInt)

  val dList = ls.foldLeft(Seq(0)){case (ds, l) =>
    ds :+ (l + ds.last)
  }

  val res = dList.count(_ <= x)

  println(res)

}
