import std.stdio, std.math, std.algorithm, std.array, std.string, std.conv, std.container, std.range;
T[] Reads(T)() { return readln.split.to!(T[]); }

void main() {
    int n, x; readf("%d %d\n", &n,&x);
    long[] l = Reads!(long);
    long d;
    int ans = d <= x;
    foreach (li ; l) {
        d = d + li;
        ans += d <= x;
    }
    writeln(ans);
}