function main(input) {
    a = input[0].split(' ');
    n = a[0];
    x = a[1];
    l = input[1].split(' ');
    var i,value = 0, ans = 0;
    for(i=0; i<n; i++) {
        l[i] = parseInt(l[i], 10);
        if (value <= x) {
            ans++;
            value += l[i];
        }
    }
    if (value <= x) ans++;
    console.log(ans);
}
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));