#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i< (n); ++i)
using namespace std;
using ll = long long;

#define PB push_back

int main(){
    int N,x;
    cin >> N >> x;
    vector<int> a(N);
    rep(i,N){
        cin >> a.at(i);
    }
    ALL(a);
    int ans = 0;
    for(int i=0;i<N;i++){
        x -= a.at(i);
        if(x == 0){
            ans++;
            break;
        }else if(x < 0){      
            break;
        }else{
            ans++;
            if(i == N-1){
               break;
            }
        }
    }
    if(x > 0 && ans == N){
        ans --;
    }
    
    cout << ans << endl;
}
