"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const X = parseInt(arg[0].split(" ")[1]);
    
    const Ls = arg[1].split(" ").map(n=>parseInt(n));
    
    let list = [];
    
    for(let i=0; i<=N; i++) {
        if(i == 0) {
            list.push(0);
        } else {
            let temp = list[i-1] + Ls[i-1];
            list.push(temp);
        }
    
    }

    console.log(list.filter(n=>n<=X).length)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));