#include <bits/stdc++.h>
using namespace std;
template <class t>
inline t read(t &x) {
  bool f = 0;
  char c = getchar();
  x = 0;
  while (!isdigit(c)) f |= c == '-', c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  if (f) x = -x;
  return x;
}
template <class t>
inline void write(t x) {
  if (x < 0)
    putchar('-'), write(-x);
  else {
    if (x > 9) write(x / 10);
    putchar('0' + x % 10);
  }
}
const long long N = 5e5 + 5;
long long n, a[N], sum, x;
signed main() {
  read(n);
  long long m = n + 1 >> 1;
  for (long long i = 1; i <= m; i++) sum += read(a[i]);
  for (long long i = m; i; i--) a[i] += a[i + 1];
  sum += read(x) * (n - m);
  if (x >= 0)
    write(sum > 0 ? n : -1);
  else {
    long long ans = n + 1;
    x = -x;
    for (long long i = 1; i <= m; i++) {
      ans = min(ans, m + (a[i] - 1) / x - i + 1);
      if (i + ans - 1 >= n) return write(min(ans, n)), 0;
    }
    write(-1);
  }
}
