#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
long long a[N], n, q[N];
long long mi[N];
long long m[N];
int main() {
  cin >> n;
  int t = (n + 1) / 2;
  for (int i = 1; i <= t; i++) scanf("%lld", a + i), q[i] = q[i - 1] + a[i];
  long long x;
  cin >> x;
  for (int i = t + 1; i <= n; i++) a[i] = x;
  for (int i = t; i >= 1; i--) m[i] = q[t] - q[i - 1] + (n / 2 - t + i) * x;
  mi[0] = 1e18;
  for (int i = 1; i <= t; i++) mi[i] = min(mi[i - 1], m[i]);
  for (int i = t; i >= 1; i--) {
    if (mi[i] + (t - i) * x > 0) {
      printf("%lld\n", n - i + 1);
      return 0;
    }
  }
  puts("-1");
  return 0;
}
