#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void Int(T &n) {
  n = 0;
  int f = 1;
  int ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
  n = n * f;
}
template <typename T>
T gcd(T a, T b) {
  return !b ? a : gcd(b, a % b);
}
template <typename T>
inline void umin(T &a, T b) {
  a = a < b ? a : b;
}
template <typename T>
inline void umax(T &a, T b) {
  a = a > b ? a : b;
}
template <typename T, typename W>
inline void Int(T &x, W &y) {
  Int(x), Int(y);
}
template <typename T, typename W, typename Q>
inline void Int(T &x, W &y, Q &z) {
  Int(x, y), Int(z);
}
const int N = 5e5 + 7;
const int inf = 1e9 + 7;
long long a[N];
long long pref[N];
int solve() {
  int n;
  cin >> n;
  int m = (n + 1) / 2;
  for (int i = 1; i <= m; ++i) {
    cin >> a[i];
  }
  long long x;
  cin >> x;
  for (int i = m + 1; i <= n; ++i) {
    a[i] = x;
  }
  long long sum = accumulate(a + 1, a + n + 1, 0LL);
  if (sum > 0) {
    return cout << n << '\n', 0;
  } else if (x >= 0) {
    return cout << -1 << '\n', 0;
  }
  for (int i = 1; i <= n; ++i) {
    pref[i] = a[i] + pref[i - 1];
  }
  long long mx = LLONG_MIN;
  for (int i = 1; i <= m; ++i) {
    long long cur = x * n - pref[n] - x * i + x + pref[i - 1];
    umax(mx, cur);
    long long xk = x * (n - i + 1);
    if (xk > mx) {
      return cout << n - i + 1 << '\n', 0;
    }
  }
  return cout << -1 << '\n', 0;
}
int main() {
  int tests = 1, CaseNo = 0;
  while (tests--) {
    solve();
  }
  return 0;
}
