object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n, x = sc.nextInt
    val list = List.fill(n)(sc.nextInt)

    def bound(dx: List[Int], bounce: List[Int]): List[Int] =
      dx.isEmpty match {
        case true => bounce
        case _    => bound(dx.tail, bounce :+ bounce.last + dx.head)
      }
    println(bound(list, List(0)).count(_ <= x))
  }
}