#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j;
  int m, l, h;
  cin >> m;
  int a[m];
  for (i = 0; i < m; i++) cin >> a[i];
  cin >> l >> h;
  int lbeg = -1, hbeg = 101, lint = -1, hint = 101;
  int sum = 0;
  for (i = 0; i < m; i++) {
    sum += a[i];
    if (sum >= l && lbeg == -1) lbeg = i + 2;
    if (sum > h) {
      hbeg = i + 1;
      break;
    }
  }
  if (lbeg > hbeg || (lbeg == -1 && hbeg == 101)) {
    cout << '0';
    return 0;
  }
  sum = 0;
  for (i = m - 1; i >= 0; i--) {
    sum += a[i];
    if (sum >= l && hint == 101) hint = i + 1;
    if (sum > h) {
      lint = i + 2;
      break;
    }
  }
  if (lint > hint || (lint == -1 && hint == 101)) {
    cout << '0';
    return 0;
  }
  if (hbeg < lint)
    cout << '0';
  else {
    if (lint >= lbeg) {
      if (lint > m)
        cout << 0;
      else
        cout << lint;
    } else {
      if (lbeg <= hint) {
        if (lbeg > m)
          cout << 0;
        else
          cout << lbeg;
      } else
        cout << '0';
    }
  }
  return 0;
}
