#include <bits/stdc++.h>
int main() {
  int sumaA, sumaB, alumnos, m, k, a, b;
  sumaA = sumaB = alumnos = 0;
  scanf("%d", &m);
  int lista[m];
  for (k = 0; k < m; k++) {
    scanf("%d", &lista[k]);
    alumnos = alumnos + lista[k];
  }
  scanf("%d%d", &a, &b);
  int j = 1;
  while (j < m) {
    for (k = 0; k < j; k++) {
      sumaA = sumaA + lista[k];
    }
    for (k = j; k < m; k++) {
      sumaB = sumaB + lista[k];
    }
    if ((sumaA >= a && sumaA <= b) && (sumaB >= a && sumaB <= b)) {
      printf("%d", j + 1);
      break;
    } else {
      sumaA = 0;
      sumaB = 0;
      j++;
    }
  }
  if (j == m) {
    printf("%d", 0);
  }
  return 0;
}
