#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using vvs = vector<vs>;
int main() {
  int n, x;
  cin >> n >> x;
  vi a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    x -= a[i];
    if (x < 0) {
      cout << ans << endl;
      return 0;
    }
    ans++;
  }
  if (x != 0) ans--;
  cout << ans << endl;
}
