import std.stdio, std.array, std.conv, std.typecons, std.algorithm;

T diff(T)(const ref T a, const ref T b) { return a > b ? a - b : b - a; }

void main() {
    immutable ip = readln.split.to!(ulong[]);
    immutable n = ip[0], x = ip[1];
    immutable ls = readln.split.to!(ulong[]);

    ulong cnt = 0;
    ulong xi = 0;

    while(xi <= x && cnt <= n) {
        xi += ls[cnt++];
    }

    writeln(cnt);
}
