import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);
//aryread!string();
//auto PS = new Tuple!(long,string)[](M);
//x[]=1;でlong[]全要素1に初期化
void main()
{
    long n, x;
    scan(n, x);
    auto l = aryread();
    long sum_x;
    long[] ans;
    ans ~= 0;
    // writeln(ans);
    foreach (i; 0 .. n)
    {
        sum_x += l[i];
        ans ~= sum_x;
    }
    // writeln(ans);
    long cnt;
    foreach (i; 0 .. ans.length)
    {
        if (ans[i] <= x)
        {
            cnt += 1;
        }
    }
    writeln(cnt);
}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}

void arywrite(T)(T a)
{
    a.map!text.join(' ').writeln;
}
