#include <bits/stdc++.h>
using namespace std;
int n, x, y;
int a[1000];
bool inrange(int v) { return (v >= x && v <= y); }
int main() {
  ios ::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] = a[i - 1] + a[i];
  }
  cin >> x >> y;
  for (int i = 1; i <= n; i++)
    if (inrange(a[i - 1]) && inrange(a[n] - a[i - 1])) {
      cout << i;
      return 0;
    }
  cout << 0;
  return 0;
}
