#include <bits/stdc++.h>
const long long MOD = 1000000007;
const int nt = 3000000;
using namespace std;
int c[300000], x, y, m, s1, s2;
int main() {
  cin >> m;
  for (int i = 1; i <= m; i++) cin >> c[i];
  cin >> x >> y;
  for (int k = 1; k <= m; k++) {
    s1 = 0;
    s2 = 0;
    for (int i = 1; i <= k - 1; i++) s1 += c[i];
    for (int i = k; i <= m; i++) s2 += c[i];
    if ((s1 >= x) && (s1 <= y) && (s2 >= x) && (s2 <= y)) {
      cout << k;
      return 0;
    }
  }
  cout << 0;
  return 0;
}
