#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int n_2 = (n + 1) / 2;
  vector<long long> a;
  a.resize(n_2);
  long long sum = 0;
  for (int i = 0; i < n_2; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  long long x;
  cin >> x;
  sum += (long long)x * (n - n_2);
  vector<long long> p, m;
  m.push_back(0);
  p.push_back(sum);
  if (sum > 0) {
    cout << n << endl;
  } else {
    long long mini = m[0];
    for (int k = n - 1; k >= n_2; --k) {
      p[0] -= x;
      p.push_back(x - a[n - k - 1]);
      m.push_back(m.back() + p.back());
      mini = min(mini, m.back());
      if (p[0] + mini > 0) {
        cout << k << endl;
        break;
      } else if (k == n_2) {
        cout << -1 << endl;
      }
    }
  }
  return 0;
}
