#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  vector<int> v(m + 1);
  int f = 0;
  int ans = 0;
  for (int i = 1; i <= m; i++) cin >> v[i];
  int x, y;
  cin >> x >> y;
  for (int i = 1; !f && i <= m; i++) {
    int be = 0, in = 0;
    for (int j = 1; j <= m; j++) {
      if (j < i) be += v[j];
      if (j >= i) in += v[j];
    }
    if (be >= x && be <= y && in >= x && in <= y) {
      ans = i;
      f = 1;
    }
  }
  cout << ans;
  return 0;
}
