#include <bits/stdc++.h>
using namespace std;
const int max_n = 500005;
int n, a[max_n], x;
long long suf[max_n];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= (n + 1) / 2; i++) scanf("%d", a + i);
  scanf("%d", &x);
  for (int i = (n + 1) / 2 + 1; i <= n; i++) a[i] = x;
  for (int i = n; i >= 1; i--) suf[i] = suf[i + 1] + a[i];
  long long mx = 1e18;
  for (int i = n; i > n / 2; i--) {
    mx = min(mx - x, suf[n - i + 1]);
    if (mx > 0) return printf("%d\n", i), 0;
  }
  printf("-1\n");
  return 0;
}
