#include <bits/stdc++.h>
using namespace std;
const int NMAX = 5e5;
int N, a[NMAX + 2];
long long suf[NMAX + 2];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  int n = (N / 2) + (N % 2);
  for (int i = 1; i <= n; i++) cin >> a[i];
  int x;
  cin >> x;
  for (int i = n + 1; i <= N; i++) a[i] = x;
  suf[N] = a[N];
  for (int i = N - 1; i >= 1; i--) suf[i] = a[i] + suf[i + 1];
  if (suf[1] > 0) {
    cout << N << '\n';
    return 0;
  }
  long long mini = suf[1], pre = suf[1];
  for (int len = N - 1; len >= n; len--) {
    pre = pre + x - a[N - len];
    mini = min(mini, pre);
    if (mini > suf[len + 1]) {
      cout << len << '\n';
      return 0;
    }
  }
  cout << -1 << '\n';
  return 0;
}
