#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 50;
int a[maxn];
int main() {
  int n, x;
  scanf("%d", &n);
  long long sum = 0;
  int up = (n + 1) / 2;
  for (int i = 1; i <= up; i++) scanf("%d", &a[i]), sum += a[i];
  scanf("%d", &x);
  if (x > 0 && sum + 1ll * x * (n / 2) > 0)
    return printf("%d\n", n), 0;
  else if (x > 0)
    return printf("-1\n"), 0;
  long long now = 1ll * x * (n - up);
  int l = up + 1, cnt = 0;
  while (l > 1) {
    while (l > 1 && now + a[l - 1] <= 0) l--, now += a[l];
    if (l == 1) return printf("-1\n"), 0;
    l--, now += a[l];
    while (l > 1 && now + a[l - 1] - x > 0) l--, cnt++, now += a[l] - x;
    if (l == 1) return printf("%d\n", n - cnt), 0;
    now += 1ll * cnt * x;
    cnt = 0;
  }
}
