#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353, N = 510000;
int n, m, a[N], x, p[N];
long long sum[N];
inline int addMod(int a, int b) { return (a += b) >= mod ? a - mod : a; }
inline long long quickpow(long long base, long long pw) {
  long long ret = 1;
  while (pw) {
    if (pw & 1) ret = ret * base % mod;
    base = base * base % mod, pw >>= 1;
  }
  return ret;
}
template <class T>
inline void read(T &x) {
  x = 0;
  char ch = getchar(), w = 0;
  while (!isdigit(ch)) w = (ch == '-'), ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  x = w ? -x : x;
  return;
}
int main() {
  read(n);
  m = (n + 1) / 2;
  for (register int i = 1; i <= m; ++i) read(a[i]), sum[i] = sum[i - 1] + a[i];
  read(x);
  if (x >= 0)
    cout << (sum[m] + (long long)(n - m) * x > 0 ? n : -1) << endl;
  else {
    x = -x;
    for (register int i = 0; i <= m; ++i)
      --p[min(
          (long long)n + 1 - i,
          max((long long)n - m + 1, (sum[m] - sum[i] + x - 1) / x + m - i))],
          ++p[n + 1 - i];
    for (register int i = n - m + 1; i <= n; ++i) {
      p[i] += p[i - 1];
      if (p[i] >= 0) {
        cout << i << endl;
        return 0;
      }
    }
    cout << -1 << endl;
  }
  return 0;
}
