#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  int num[1000];
  int x, y;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> num[i];
    sum += num[i];
  }
  cin >> x >> y;
  int cur = 0;
  for (int i = 1; i <= n; i++) {
    if (cur >= x && cur <= y && (sum - cur) >= x && (sum - cur) <= y) {
      cout << i << endl;
      return 0;
    }
    cur += num[i];
  }
  cout << 0 << endl;
}
