#include <bits/stdc++.h>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 62;
constexpr int inf = 1000000007;
constexpr long long mod = 1000000007LL;
const long double PI = acos(-1);
using namespace std;
int main() {
  long long n;
  scanf("%lld", &n);
  int sz = (n + 1) / 2;
  vector<long long> a(sz);
  for (int i = 0; i < sz; i++) scanf("%lld", &a[i]);
  long long x;
  scanf("%lld", &x);
  vector<long long> mn(sz + 1, 0);
  vector<long long> p(sz + 1);
  for (int i = 0; i < sz; i++) p[i + 1] = p[i] + x - a[i];
  for (int i = 1; i <= sz; i++) mn[i] = min(mn[i - 1], p[i]);
  long long sum = 0;
  for (int i = 0; i < sz; i++) sum += a[i];
  for (int k = sz; k <= n; k++) {
    if (sum + mn[n - k] > 0) {
      printf("%d\n", k);
      return 0;
    }
    sum += x;
  }
  puts("-1");
  return 0;
}
