#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, c[123], x, y, sum = 0, left = 0, right = 0, ans = 0;
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> c[i];
    sum += c[i];
  }
  cin >> x >> y;
  for (int i = 0; i < m; i++) {
    if (left + c[i] <= y)
      left += c[i];
    else {
      break;
    }
    if (left >= x) {
      right = 0;
      for (int j = i + 1; j < m; j++) {
        right += c[j];
      }
      if (right >= x && right <= y) {
        ans = i + 2;
        break;
      }
    }
  }
  cout << ans;
}
