#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
long long a[N], pre[N], mx[N];
int main() {
  int n, x, m, ok = 0;
  scanf("%d", &n);
  m = (n + 1) / 2;
  for (int i = 1; i <= m; i++) scanf("%lld", &pre[i]), pre[i] += pre[i - 1];
  scanf("%d", &x);
  for (int i = m + 1; i <= n; i++) pre[i] = pre[i - 1] + x;
  for (int i = 1; i <= m; i++) mx[i] = max(mx[i - 1], pre[i] - 1LL * i * x);
  if (pre[n] > 0)
    printf("%d\n", n), ok = 1;
  else if (x >= 0)
    puts("-1"), ok = 1;
  if (ok) return 0;
  for (int k = m; k <= n; k++) {
    if (mx[n - k] < pre[k]) {
      printf("%d\n", k);
      return 0;
    }
  }
  puts("-1");
  return 0;
}
