#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> v(n + 1);
  for (int i = 1; i <= n; ++i) cin >> v[i];
  int x, y;
  scanf("%d %d", &x, &y);
  for (int i = 1; i <= n; ++i) {
    int a = 0, b = 0;
    for (int j = 1; j <= n; ++j) {
      if (j < i)
        a += v[j];
      else
        b += v[j];
    }
    if (x <= a and a <= y and x <= b and b <= y) return !printf("%d\n", i);
  }
  puts("0");
}
