#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  vector<int> c;
  c.clear();
  for (int i = 0; i < m; i++) {
    int v;
    cin >> v;
    c.push_back(v);
  }
  int x, y;
  cin >> x >> y;
  for (int k = 1; k <= 10000; k++) {
    int a = 0, b = 0;
    for (int i = 0; i < (int)c.size(); i++) {
      if (i + 1 < k)
        a += c[i];
      else
        b += c[i];
    }
    if (a >= x && b >= x && a <= y && b <= y) {
      cout << k << endl;
      return 0;
    }
    if (a > y) break;
  }
  cout << 0 << endl;
  return 0;
}
