#include <bits/stdc++.h>
using namespace std;
int tong, c[110], m, dau, cuoi;
void nhap();
void solve();
void mofile() { freopen("A.inp", "r", stdin); }
int main() {
  nhap();
  solve();
}
void nhap() {
  scanf("%d\n", &m);
  tong = 0;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &c[i]);
    tong += c[i];
  }
  scanf("\n");
  scanf("%d%d", &dau, &cuoi);
}
void solve() {
  int i, dem = 0;
  bool ok = false;
  for (i = m; i >= 1; i--) {
    dem += c[i];
    if (dem >= dau && dem <= cuoi && (tong - dem) >= dau &&
        (tong - dem) <= cuoi) {
      printf("%d", i);
      ok = true;
      break;
    }
  }
  if (!ok) printf("%d", 0);
}
