#include <bits/stdc++.h>
using namespace std;
long long n, x, nb, ne;
long long as[500005];
long long suma[500005], min_suma[500005];
long long tot = 0;
long long solve() {
  if (tot > 0) return n;
  if (tot <= 0 && x >= 0) return -1;
  for (int i = 0; i < nb; i++) {
    as[i] -= x;
  }
  for (int i = nb - 1; i >= 0; i--) {
    suma[i] = as[i];
    if (i < nb - 1) {
      suma[i] += suma[i + 1];
    }
  }
  for (int i = 0; i < nb; i++) {
    min_suma[i] = suma[i];
    if (i > 0) {
      min_suma[i] = min(min_suma[i], min_suma[i - 1]);
    }
  }
  for (long long k = ne + 1; k < n; k++) {
    long long min_s = min_suma[nb - (k - ne)] + k * x;
    if (min_s > 0) return k;
  }
  return -1;
}
int main() {
  cin >> n;
  nb = (n + 1) / 2;
  ne = n / 2;
  for (int i = 0; i < (n + 1) / 2; i++) {
    cin >> as[i];
    tot += as[i];
  }
  cin >> x;
  tot += n / 2 * x;
  cout << solve() << endl;
  return 0;
}
