#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  int a[102];
  int x, y;
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
  }
  cin >> x >> y;
  int cnt = 1;
  int flag = 1;
  int flag1 = 1;
  while (flag) {
    int sum1 = 0;
    int sum2 = 0;
    for (int i = 1; i < cnt; i++) sum1 += a[i];
    for (int i = cnt; i <= m; i++) sum2 += a[i];
    if (sum1 >= x && sum1 <= y && sum2 >= x && sum2 <= y)
      flag = 0;
    else if (cnt > m) {
      flag1 = 0;
      flag = 0;
    } else
      cnt++;
  }
  if (flag1 == 1)
    cout << cnt << endl;
  else
    cout << "0" << endl;
  return 0;
}
