#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
const long long inf = 1e17 + 7;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  cout.precision(10);
  long long n;
  cin >> n;
  vector<long long> a((n + 3) / 2);
  long long x, sum = 0;
  ;
  for (long long i = 1; i < (n + 3) / 2; i++) {
    cin >> a[i];
    sum += a[i];
  }
  cin >> x;
  if (x > 0) {
    cout << (sum + (n / 2) * x > 0 ? n : -1);
    return 0;
  }
  vector<long long> b((n + 3) / 2);
  for (long long i = 1; i < (n + 3) / 2; i++) {
    b[i] = b[i - 1] + x - a[i];
  }
  for (long long i = 1; i < (n + 3) / 2; i++) {
    b[i] = min(b[i], b[i - 1]);
  }
  for (long long k = n - n / 2; k <= n; k++) {
    long long s = sum + x * (k - (n + 1) / 2);
    long long c = b[n - k];
    if (s + c > 0) {
      cout << k;
      return 0;
    }
  }
  cout << -1;
}
