#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  int count = 0;
  scanf("%d%d", &a, &b);
  for (int i = 0; i < a - 1; i++) {
    int s;
    scanf("%d", &s);
    if (s <= b) {
      count++;
      b = b - s;
    } else {
      break;
    }
  }
  int s;
  scanf("%d", &s);
  if (b == s) {
    count++;
  }
  printf("%d", count);
  return 0;
}
