#include <bits/stdc++.h>
using namespace std;
int source[102];
int main() {
  int n, x, y, sum = 0, p = 0, res = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> source[i];
    sum += source[i];
  }
  cin >> x >> y;
  for (int i = 1; i <= n; i++) {
    p += source[i];
    if (p >= x) {
      res = i;
      break;
    }
  }
  bool flag = false;
  for (int i = res + 1; i <= n && p <= y; i++) {
    if (sum - p <= y && sum - p >= x) {
      flag = true;
      break;
    } else {
      p += source[i];
      res++;
    }
  }
  if (flag) {
    cout << res + 1 << endl;
  } else {
    cout << 0 << endl;
  }
  return 0;
}
