#include <bits/stdc++.h>
using namespace std;
const int MX = 5e5 + 5;
int n, x, a[MX / 2], u;
long long m[MX / 2];
void solve() {
  cin >> n;
  u = (n + 1) / 2;
  for (int i = (0); i < (u); ++i) cin >> a[i + 1];
  cin >> x;
  m[0] = 0;
  long long ms = 0;
  for (int i = (0); i < (u); ++i) {
    ms += x - a[i + 1];
    m[i + 1] = min(m[i], ms);
  }
  long long as = 0;
  for (int i = (0); i < (u); ++i) as += a[i + 1];
  for (int k = (u); k <= (n); ++k) {
    if (as + m[n - k] > 0) {
      cout << k << '\n';
      return;
    }
    as += x;
  }
  cout << "-1\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
}
