#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  return (b) == 0 ? (a) : gcd((b), ((a) % (b)));
}
template <class T>
inline T lcm(T a, T b) {
  return ((a) / gcd((a), (b)) * (b));
}
template <class T>
inline T BigMod(T Base, T power, T M = 1000000007) {
  if (power == 0) return 1;
  if (power & 1)
    return ((Base % M) * (BigMod(Base, power - 1, M) % M)) % M;
  else {
    T y = BigMod(Base, power / 2, M) % M;
    return (y * y) % M;
  }
}
template <class T>
inline T ModInv(T A, T M = 1000000007) {
  return BigMod(A, M - 2, M);
}
int fx[] = {-1, +0, +1, +0, +1, +1, -1, -1, +0};
int fy[] = {+0, -1, +0, +1, +1, -1, +1, -1, +0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
vector<long long> arr(500005 + 1);
int n;
bool ok(int k) {
  for (int i = 1; i <= n - k + 1; i++) {
    if (arr[i + k - 1] - arr[i - 1] <= 0) return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (n + 1) / 2; i++) {
    cin >> a[i];
  }
  long long x;
  cin >> x;
  for (int i = (n + 1) / 2; i < n; i++) {
    a[i] = x;
  }
  vector<long long> pre(n + 1);
  for (int i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] + a[i - 1];
  }
  if (pre[n] > 0) {
    cout << n << endl;
    return 0;
  } else if (a[n - 1] >= 0) {
    cout << -1 << endl;
    return 0;
  } else {
    long long mx = -1e18;
    for (int i = 0; i < (n + 1) / 2; i++) {
      mx = max(mx, pre[i] + x * (n - i) - pre[n]);
      if (mx < x * (n - i)) {
        cout << n - i << endl;
        return 0;
      }
    }
  }
  cout << -1 << endl;
  return 0;
}
