#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c;
  cin >> n >> c;
  vector<int> v(n);
  for (int i = (0); i < (n); ++i) cin >> v[i];
  int ans = 0;
  long long sum = 0;
  for (int i = (0); i < (n); ++i) sum = sum + v[i];
  if (sum == c) {
    cout << n << endl;
    return 0;
  }
  for (int i = (0); i < (n - 1); ++i) {
    if (v[i] > c) break;
    ans++;
    c -= v[i];
  }
  cout << ans << endl;
  return 0;
}
