#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e6 + 100;
const int mod = (int)1e9 + 7;
int n;
long long pre[maxn], sub[maxn], a[maxn], x, tot;
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin >> n;
  int lim = (n + 1) / 2, ans = n / 2 + 1;
  for (auto i = (1); i <= (lim); ++i) cin >> a[i], pre[i] = pre[i - 1] + a[i];
  for (auto i = (lim); i >= (1); --i) sub[i] = sub[i + 1] + a[i];
  cin >> x;
  tot = x * (n / 2);
  if (x > 0) {
    ans = -1;
    if (pre[lim] + (n / 2) * x > 0) ans = n;
    cout << ans;
    return 0;
  }
  int op = 0;
  for (auto i = (lim); i >= (1); --i) {
    tot += a[i];
    if (op) tot -= x;
    if (tot <= 0) {
      if (op)
        ans = n - i + 2, tot = x * (n / 2) + pre[lim] - pre[i - 1], op = 0;
      else
        ans++;
    } else
      op = 1;
  }
  if (ans == n + 1) ans = -1;
  cout << ans;
}
