import java.util.Scanner

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

    println(ls.scanLeft(0)((acc, m) => acc + m).takeWhile(m => m <= x).length)
  }

  def printArray[T](arr: Array[T]): Unit = {
    for (i <- 0 until (arr.length - 1)) {
      print(s"${arr(i)} ")
    }

    println(arr(arr.length - 1))
  }
}
