#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
const long long mod = 998244353;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
long long n, tot;
long long a[N], sum[N];
int main() {
  long long k, q, _;
  long long m;
  cin >> n;
  for (int i = 1; i <= (n + 1) / 2; i++)
    cin >> a[i], sum[i] = sum[i - 1] + a[i];
  cin >> m;
  for (int i = (n + 1) / 2 + 1; i <= n; i++)
    a[i] = m, sum[i] = sum[i - 1] + a[i];
  if (m >= 0) {
    if (sum[n] > 0)
      cout << n << endl;
    else
      cout << -1 << endl;
    return 0;
  }
  long long ans = 0;
  long long mi = sum[n];
  if (mi > 0) {
    cout << n << endl;
    return 0;
  }
  for (int i = 1; i <= (n + 1) / 2; i++) {
    mi -= m;
    long long tmp = sum[n] - sum[i];
    mi = min(tmp, mi);
    if (mi > 0) {
      cout << n - i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}
