#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
using namespace std;
long long n, a[500005], pref[500005], x, v[500005];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (long long i = 1; i <= (n + 1) / 2; i++) {
    cin >> a[i];
  }
  cin >> x;
  for (long long i = (n + 1) / 2 + 1; i <= n; i++) {
    a[i] = x;
  }
  for (long long i = 2; i <= n; i++) {
    pref[i] = pref[i - 1] + x - a[i - 1];
  }
  v[1] = 0;
  for (long long i = 1; i <= n; i++) {
    v[i] = min(v[i - 1], pref[i]);
  }
  long long sum = 0;
  for (long long i = 1; i <= n / 2; i++) {
    sum = sum + a[i];
  }
  for (long long k = n / 2 + 1; k <= n; k++) {
    sum = sum + a[k];
    if (sum + v[n - k + 1] > 0) {
      cout << k << '\n';
      return 0;
    }
  }
  cout << "-1" << '\n';
  return 0;
}
