#include <bits/stdc++.h>
using namespace std;
int n;
long long x;
long long a[1000005];
long long m[1000005];
long long s[1000005];
int main() {
  ios_base::sync_with_stdio(false);
  scanf("%d", &n);
  for (int i = 1; i <= (n + 1) / 2; i++) {
    scanf("%lld", a + i);
  }
  scanf("%lld", &x);
  for (int i = (n + 1) / 2 + 1; i <= n; i++) {
    a[i] = x;
  }
  for (int i = 1; i <= n; i++) {
    s[i] = s[i - 1] + a[i];
  }
  long long last = 0;
  m[1] = 0;
  for (int i = 2; i <= n + 1; i++) {
    last += x - a[i - 1];
    m[i] = min(m[i - 1], last);
  }
  for (int k = (n + 1) / 2; k <= n; k++) {
    if (s[k] + m[n - k + 1] > 0) {
      cout << k << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
