#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umin(T& a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool umax(T& a, T b) {
  return a < b ? (a = b, true) : false;
}
long long POW(long long a, long long p, long long M) {
  if (!p) return 1LL;
  long long T = POW(a, p / 2, M);
  T = T * T % M;
  if (p & 1) T = T * (a % M) % M;
  return T;
}
long long SQRT(long long a) {
  long long b = (long long)sqrtl(((double)a) + 0.5);
  while (b * b < a) ++b;
  while (b * b > a) --b;
  return (b * b == a) ? b : -1;
}
const long long MOD = 1e9 + 7;
const long long N = 5e5 + 2;
long long pref[N];
long long solve1(long long n, vector<long long>& a, long long x) {
  if (pref[(n + 1) / 2] + n / 2 * x > 0) return n;
  long long lst = (n + 1) / 2;
  long long l = 0;
  for (long long i = 0; i < (n + 1) / 2; i++) {
    long long sm = pref[lst] - pref[i];
    sm += i * x;
    if (sm > 0)
      umax(l, lst - i);
    else {
      long long lim = (-sm) / x;
      lim++;
      if (lim > (n / 2 - i)) {
        umax(l, n - i + 1);
        break;
      } else
        umax(l, lst + lim);
    }
  }
  if (l >= 1 && l <= n) return l;
  return -1;
}
long long solve2(long long n, vector<long long>& a, long long x) {
  if (pref[(n + 1) / 2] + n / 2 * x > 0) return n;
  long long lst = (n + 1) / 2;
  long long r = n + 1;
  for (long long i = 0; i < lst; i++) {
    long long sm = pref[lst] - pref[i];
    sm += i * x;
    if (sm <= 0) {
      umax(r, n - i + 1);
      break;
    }
    if (x < 0) {
      long long lim = (sm - 1) / (-x);
      umin(r, lst + lim);
    } else {
      umin(r, n - i);
    }
    if (r == n - i) break;
  }
  if (r >= 1 && r <= n) return r;
  return -1;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  long long n;
  cin >> n;
  vector<long long> a((n + 1) / 2);
  for (long long i = 0; i < (n + 1) / 2; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < (n + 1) / 2; i++) pref[i + 1] = pref[i] + a[i];
  long long x;
  cin >> x;
  long long ans = -1;
  if (x > 0)
    ans = solve1(n, a, x);
  else
    ans = solve2(n, a, x);
  if (ans == -1) {
    cout << -1 << endl;
    return 0;
  }
  bool ok = 1;
  for (long long i = 0; i < n / 2; i++) a.push_back(x);
  for (long long i = 0; i < n; i++) pref[i + 1] = pref[i] + a[i];
  for (long long i = 0; i < n - ans + 1; i++)
    ok &= (pref[i + ans] - pref[i] > 0);
  if (ok)
    cout << ans << endl;
  else
    cout << -1 << endl;
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s\n";
  return 0;
}
