#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
using V = vector<T>;
template <class T, class U>
using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
constexpr ll MOD = 1000000007;
constexpr ll HIGHINF = (ll)1e18;
constexpr int INF = 1e9;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int hn = (n + 1) / 2;
  vll a(hn);
  for (int i = 0; i < hn; i++) cin >> a[i];
  ll x;
  cin >> x;
  vll m(hn + 1, 0);
  ll pres = 0;
  for (int i = 0; i < hn; i++) {
    pres += x - a[i];
    m[i + 1] = min(m[i], pres);
  }
  ll tmp = 0;
  for (int i = 0; i < hn; i++) tmp += a[i];
  for (int i = hn; i <= n; i++) {
    if (tmp + m[n - i] > 0) {
      cout << i << '\n';
      return 0;
    }
    tmp += x;
  }
  cout << -1 << '\n';
  return 0;
}
