#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int k = (n + 1) / 2;
  vector<int> A(k);
  for (int& a : A) scanf("%d", &a);
  int x;
  scanf("%d", &x);
  A.resize(n, x);
  long long sum = accumulate(begin(A), begin(A) + k, 0LL);
  long long min_sum = sum;
  int res = -1;
  for (long long i = k, s = 1LL * x * (n - k); i < n; ++i, s -= x) {
    if (min_sum + s > 0) {
      res = n + k - i;
      break;
    }
    sum += A[i] - A[i - k];
    min_sum = min(min_sum, sum);
  }
  if (res == -1 && min_sum > 0) res = k;
  printf("%d\n", res);
}
