#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + (c - '0'), c = getchar();
  return f * x;
}
void MOD(int &x) {
  if (x >= 1000000007) x -= 1000000007;
}
long long a[500010];
int main() {
  int n;
  n = read();
  for (int i = 1; i <= (n + 1) / 2; i++) a[i] = read();
  for (int i = (n + 1) / 2; i >= 1; i--) a[i] += a[i + 1];
  long long x;
  x = read();
  if (x >= 0) {
    int r = 0;
    for (int i = 1; i <= (n + 1) / 2; i++) {
      if (a[i] + 1ll * x * (n / 2) <= 0) return puts("-1"), 0;
      if (a[i] > 0)
        r = max(r, n - i + 1);
      else
        r = max(r, (n + 1) / 2 - i + 1 + (int)((1 - a[i] + x - 1) / x));
      if (i + r - 1 == n) return printf("%d\n", r), 0;
    }
  } else {
    int k = n;
    for (int i = 1; i <= (n + 1) / 2; i++) {
      if (a[i] <= 0) return puts("-1"), 0;
      if (a[i] + 1ll * x * (n / 2) > 0)
        k = min(k, n - i + 1);
      else
        k = min(k, (n + 1) / 2 - i + 1 + (int)((a[i] - 1) / (-x)));
      if (i + k - 1 == n) return printf("%d\n", k), 0;
    }
    puts("-1");
  }
}
