#include <bits/stdc++.h>
using namespace std;
vector<long long> v, vc;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long a = 0, b = 0, c, d, e, f = 0, l, g, m, n, k, i, j, t, p, q, r, s, x;
  cin >> n;
  for (i = 0; i < ceil(n / 2.0); i++) {
    cin >> a;
    v.push_back(a);
  }
  cin >> x;
  l = v.size();
  while (v.size() < n) v.push_back(x);
  for (i = 0; i < l; i++) {
    vc.push_back(x - v[i]);
  }
  for (i = 1; i < l; i++) {
    vc[i] += vc[i - 1];
  }
  for (i = 1; i < l; i++) {
    vc[i] = min(vc[i - 1], vc[i]);
  }
  for (i = 1; i < n; i++) v[i] += v[i - 1];
  f = -1;
  for (i = l - 1; i < n; i++) {
    p = v[i];
    if (v[i] <= 0) continue;
    d = n - i - 1;
    q = d > 0 ? vc[d - 1] : 0;
    if (p + q > 0) {
      f = i + 1;
      break;
    }
  }
  cout << f << '\n';
  return 0;
}
