// Arup Guha
// 6/13/2024
// Solution to Kattis Problem: Server
// https://open.kattis.com/problems/server

using namespace std;
#include <bits/stdc++.h>

int main() {

    int n, tot, tmp;
    cin >> n >> tot;

    // Set up current sum and result.
    int cur = 0, res = 0;

    // Read the numbers.
    for (int i=0; i<n; i++) {
        cin >> tmp;

        // Make sure we can add it, if not get out.
        if (cur + tmp <= tot) res++;
        else break;

        // Now it's part of our total sum.
        cur += tmp;
    }

    // Ta da!
    cout << res << endl;
    return 0;
}
