#include <bits/stdc++.h>
using namespace std;
const int maxn = 500000 + 10;
const double eps = 1e-8;
long long a[maxn], first;
long long p[maxn], prep[maxn], m[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= (n + 1) / 2; i++) {
    cin >> a[i];
    p[1] += a[i];
  }
  cin >> first;
  for (int i = 1; i <= (n + 1) / 2; i++) {
    p[i + 1] = first - a[i];
    prep[i + 1] = prep[i] + p[i + 1];
    m[i + 1] = min(m[i], prep[i + 1]);
  }
  for (int k = (n + 1) / 2; k <= n; k++) {
    if (p[1] + m[n - k + 1] + first * (k - (n + 1) / 2) > 0) {
      printf("%d\n", k);
      return 0;
    }
  }
  puts("-1");
}
