#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long N = 1e6 + 10;
const long long inf = (long long)1e12 + 10ll;
const long long mod = 1e9 + 7;
const long long eps = 1e-9;
const char spc = 29;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
using namespace std;
long long n;
long long a[N];
long long pref[N];
long long first;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < (n + 1) / 2; ++i) cin >> a[i];
  cin >> first;
  for (long long i = 0; i < n / 2; ++i) a[(n + 1) / 2 + i] = first;
  for (long long i = 0; i < n; ++i) pref[i + 1] = pref[i] + a[i];
  for (long long k = 1; k <= n; ++k) {
    long long mn = inf;
    long long mnpos = -1;
    for (long long i = 0; i <= n - k; ++i)
      if (pref[i + k] - pref[i] < mn) {
        mn = pref[i + k] - pref[i];
        mnpos = i;
      }
    if (mn > 0) {
      cout << k << endl;
      return 0;
    }
    long long nk = k + 1;
    for (long long i = mnpos + k; i < n; ++i)
      if (mn + a[i] > 0)
        break;
      else {
        ++nk;
        mn += a[i];
      }
    if (mn <= 0) {
      for (long long i = mnpos - 1; i >= 0; --i)
        if (mn + a[i] > 0)
          break;
        else {
          ++nk;
          mn += a[i];
        }
    }
    k = nk - 1;
  }
  cout << -1 << endl;
}
