fun main(args: Array<String>) {
    fun <T1, T2> scan(f: (T2, T1) -> T2, init: T2, list: List<T1>): List<T2> {
        var tmp = init
        return list.map {
            tmp = f(tmp, it)
            tmp
        }
    }
    val (n, x) = readLine()!!.split(' ').map(String::toInt)
    val l = readLine()!!.split(' ').map(String::toInt)
    val po = scan({ acc, i -> acc + i}, 0, l).indexOfLast { it <= x }
    println(po + 2)
}

