#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7, N = 1e6 + 10;
const ll INF = 1e18;
ll A[N];
ll n;
ll pre[N];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  ll m, x;
  cin >> n;
  m = (n + 1) / 2;
  for (ll i = 1; i <= m; i++) {
    cin >> A[i];
  }
  cin >> x;
  for (ll i = m + 1; i <= n; i++) {
    A[i] = x;
  }
  ll sm = 0, p = 0;
  ll k = m;
  for (ll i = 1; i <= k; i++) {
    sm += A[i];
  }
  vector<ll> T = {sm};
  for (ll i = k + 1; i <= n; i++) {
    sm += A[i];
    sm -= A[i - k];
    T.push_back(sm);
  }
  ll lst = T.size();
  ll mn = 1e18;
  for (ll i = 0; i < lst; i++) {
    mn = min(mn, T[i]);
    pre[i] = mn;
  }
  lst--;
  for (ll i = k; i <= n; i++) {
    if (pre[lst] + (i - k) * x > 0) {
      return cout << i, 0;
    }
    lst--;
  }
  cout << "-1\n";
  return 0;
}
