#include <bits/stdc++.h>
using namespace std;
int n;
const int maxn = 5e5 + 100;
int a[maxn];
long long sum[maxn];
int main() {
  scanf("%d", &n);
  int l1 = (n + 1) / 2;
  int l2 = n - l1;
  for (int i = 1; i <= l1; i++) {
    scanf("%d", a + i);
    sum[i] = sum[i - 1] + a[i];
  }
  int x;
  scanf("%d", &x);
  long long minn = 1e18;
  int res = -1;
  for (int i = 1; i <= l1; i++) {
    long long tmp = (sum[l1] - sum[i - 1]) + 1ll * l2 * x;
    if (i == 1) {
      minn = tmp;
    } else {
      minn -= x;
      minn = min(minn, tmp);
    }
    if (minn > 0) res = n - i + 1;
  }
  printf("%d", res);
  return 0;
}
