#include <bits/stdc++.h>
using namespace std;
const long long maxn = 500010;
long long n, x;
long long l, r;
long long a[maxn];
void merge(long long x, long long y) {
  l = max(x, l), r = min(y, r);
  if (l > r) {
    puts("-1");
    exit(0);
  }
}
signed main() {
  cin >> n;
  long long t = n / 2 + n % 2, s = 0;
  l = t, r = n;
  for (register long long i = 1; i <= t; ++i) scanf("%lld", &a[i]), s += a[i];
  cin >> x;
  for (register long long i = 1; i <= t; ++i) {
    if (r >= n - i + 2) {
      cout << r << endl;
      return 0;
    }
    if (s <= 0 && x <= 0) {
      puts("-1");
      exit(0);
    }
    if (x == 0) {
      merge(t - i + 1, n - i + 1);
      if (r >= n - i + 1) {
        cout << r << endl;
        return 0;
      }
      continue;
    }
    long long d;
    d = -s / x;
    if (x <= 0)
      if (s % x == 0)
        merge(t - i + 1, t - i + d);
      else
        merge(t - i + 1, t - i + d + 1);
    if (x > 0) merge(t - i + d + 2, n - i + 1);
    s -= a[i];
    if (r >= n - i + 1) {
      cout << r << endl;
      return 0;
    }
  }
  if (x <= 0)
    puts("-1");
  else
    cout << t << endl;
  return 0;
}
