#include <bits/stdc++.h>
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long MAXN = 1123456;
const long long N = 3e5 + 5;
const long long inf = 1e18;
const int mod = 1e9 + 7;
mt19937_64 rnd(chrono::system_clock::now().time_since_epoch().count());
template <typename T>
void vout(T s) {
  cout << s << endl;
  exit(0);
}
long long t[3 * MAXN], t1[3 * MAXN];
void push(long long &v) {
  t[v << 1] += t1[v];
  t[v << 1 | 1] += t1[v];
  t1[v << 1] += t1[v];
  t1[v << 1 | 1] += t1[v];
  t1[v] = 0;
}
void modify(long long v, long long tl, long long tr, long long l, long long r,
            long long val) {
  if (l > r) return;
  if (tl == l && tr == r) {
    t[v] += val;
    t1[v] += val;
    return;
  }
  long long tm = (tl + tr) >> 1;
  push(v);
  modify(v << 1, tl, tm, l, min(r, tm), val);
  modify(v << 1 | 1, tm + 1, tr, max(l, tm + 1), r, val);
  t[v] = min(t[v << 1], t[v << 1 | 1]);
}
long long get(long long v, long long tl, long long tr, long long l,
              long long r) {
  if (l > r) return inf;
  if (tl == l && tr == r) return t[v];
  long long tm = (tl + tr) >> 1;
  push(v);
  return min(get(v << 1, tl, tm, l, min(r, tm)),
             get(v << 1 | 1, tm + 1, tr, max(l, tm + 1), r));
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<long long> a(n + 1);
  for (int i = 1; i <= (n + 1) / 2; i++) cin >> a[i];
  long long x;
  cin >> x;
  for (int i = (n + 1) / 2 + 1; i <= n; i++) a[i] = x;
  vector<long long> pref(n + 1);
  for (int i = 1; i <= n; i++) {
    pref[i] = pref[i - 1] + a[i];
  }
  if (pref[n] > 0) vout(n);
  if (x <= 0) {
    long long pos = (n + 1) / 2 + 1;
    long long t = (n + 1) / 2;
    for (int i = 1; i <= n; i++)
      if (i + t - 1 <= n) {
        modify(1, 1, n, i, i, pref[i + t - 1] - pref[i - 1]);
      }
    for (int k = (n + 1) / 2; k <= n; k++) {
      if (get(1, 1, n, 1, n - k + 1) > 0) vout(k);
      modify(1, 1, n, 1, n, x);
    }
    vout(-1);
  } else {
    vout(-1);
  }
  return 0;
}
