#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n, x;
  cin >> n;
  long long ln = ((n + 1) / 2);
  long long a[ln];
  for (long long i = 0; i < ln; ++i) {
    cin >> a[i];
  }
  cin >> x;
  long long b[n];
  for (long long m = 0; m < ln; ++m) {
    b[m] = a[m];
  }
  for (long long i = ln; i < n; ++i) {
    b[i] = x;
  }
  long long pref[n + 1];
  pref[0] = 0;
  for (long long l = 1; l < n + 1; ++l) {
    pref[l] = pref[l - 1] + b[l - 1];
  }
  long long add[ln];
  add[0] = 0;
  for (long long j = 1; j < ln; ++j) {
    add[j] = add[j - 1] - a[j - 1] + x;
  }
  long long mn[ln];
  mn[0] = add[0];
  for (long long k = 1; k < ln; ++k) {
    mn[k] = min(mn[k - 1], add[k]);
  }
  for (long long k = (n / 2) + 1; k <= n; ++k) {
    if (pref[k] + mn[n - k] > 0) {
      cout << k;
      exit(0);
    }
  }
  cout << -1;
}
