import scala.annotation.tailrec
import scala.collection.mutable
import scala.io.StdIn._
object Main extends App {
  val Array(n, x) = readLine.trim.split(' ').map(_.toInt)
  val ls = readLine.trim.split(' ').map(_.toInt)
  println(
    ls.scan(0){(d, l) ⇒ d + l}.count(_ <= x)
  )
  implicit class Scope[T](val receiver: T) extends AnyVal {
    def let[A](@inline func: T ⇒ A): A = func(receiver)
    def tap(@inline func: T ⇒ Unit): T = {
      func(receiver)
      receiver
    }
  }
}
