#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  long long N = (n + 1) / 2;
  vector<long long> a(N);
  for (long long &el : a) cin >> el;
  long long Ax;
  cin >> Ax;
  vector<long long> m(N + 1, 0);
  long long Pprefsm = 0;
  for (long long i = 1; i < N + 1; ++i) {
    Pprefsm += Ax - a[i - 1];
    m[i] = min(m[i - 1], Pprefsm);
  }
  long long Aprefsm = 0;
  for (long long k = 1; k <= N; ++k) Aprefsm += a[k - 1];
  for (long long k = N; k <= n; ++k) {
    if (Aprefsm + m[n - k] > 0) return cout << k, 0;
    Aprefsm += Ax;
  }
  cout << -1;
}
