#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());
template <class T = int>
T __rand(T range = numeric_limits<T>::max()) {
  return (T)(rng() % range);
}
template <class T>
ostream& operator,(ostream& out, const T& thing) {
  return out << ", " << thing;
}
template <class U, class V>
ostream& operator<<(ostream& out, const pair<U, V>& p) {
  return (out << "(" << p.first, p.second) << ")";
}
template <class A, class B>
ostream& operator<<(ostream& out, const tuple<A, B>& t) {
  return (out << "(" << get<0>(t), get<1>(t)) << ")";
}
template <class A, class B, class C>
ostream& operator<<(ostream& out, const tuple<A, B, C>& t) {
  return (out << "(" << get<0>(t), get<1>(t), get<2>(t)) << ")";
}
template <class T>
ostream& operator<<(ostream& out, const vector<T>& container) {
  out << "{";
  if (((int)container.size())) out << container[0];
  for (int i = 0; i++ < ((int)container.size()) - 1;) out, container[i];
  return out << "}";
}
template <class x>
vector<typename x::value_type> $v(const x& a) {
  return vector<typename x::value_type>(a.begin(), a.end());
}
template <class u>
vector<typename iterator_traits<u>::value_type> $v(u a, u b) {
  return vector<typename iterator_traits<u>::value_type>(a, b);
}
const int maxn = 501010;
int n;
int a[maxn];
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = -1; ++i < (n + 1) / 2;) cin >> a[i];
  int x;
  cin >> x;
  vector<long long> s;
  s.push_back(accumulate(a, a + (n + 1) / 2, 0LL));
  ;
  for (int i = (n + 1) / 2; i < n; ++i) {
    s.push_back(s.back() + x - a[i - (n + 1) / 2]);
  }
  vector<long long> min_st(1, LLONG_MAX);
  for (auto i : s) {
    min_st.push_back(min(min_st.back(), i));
  }
  long long added = 0;
  int ans = (n + 1) / 2;
  while (((int)min_st.size()) > 1) {
    if (min_st.back() + added > 0) {
      cout << ans;
      return 0;
    }
    ++ans;
    added += x;
    min_st.pop_back();
  }
  cout << -1;
  return 0;
}
