import java.lang.Integer.parseInt
import java.util.*

fun main(args: Array<String>) {
    val argList = Scanner(System.`in`)

    val arg = argList.nextLine().split(" ")
    var N = parseInt(arg[0])
    val X = parseInt(arg[1])
    val L = argList.nextLine().split(" ").map { parseInt(it) }

    var count = 0
    var current = 0

    L.forEach {
        if (current <= X) {
            count++
            current += it
        }
    }.let { if (current <= X) count++  }

    println(count)
}
