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