#include <bits/stdc++.h>
using namespace std;
long long m[500010], a[500010];
long long pref[500010];
long long pr[500010];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < (n + 1) / 2; i++) {
    cin >> a[i];
  }
  long long pp = (n + 1) / 2;
  long long x;
  cin >> x;
  for (long long i = pp; i < n; i++) {
    a[i] = x;
  }
  for (long long i = 0; i < n; i++) {
    pref[i + 1] = pref[i] + a[i];
  }
  for (long long i = 0; i < pp; i++) {
    pr[i + 1] = pr[i] + x - a[i];
  }
  m[0] = 1000000000000;
  for (long long i = 2; i <= pp + 1; i++) {
    m[i] = min(m[i - 1], pr[i - 1]);
  }
  for (long long k = (n + 1) / 2; k <= n; ++k) {
    if (pref[k] + m[n - k + 1] > 0 && pref[k] > 0) {
      cout << k << endl;
      return 0;
    }
  }
  cout << -1;
  return 0;
}
