#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
long long a[maxn], suf[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= (n + 1) / 2; ++i) cin >> a[i];
  long long x;
  cin >> x;
  for (int i = (n + 1) / 2 + 1; i <= n; ++i) a[i] = x;
  for (int i = n; i >= 1; --i) suf[i] = suf[i + 1] + a[i];
  long long now = 1e18;
  for (int k = n; k >= (n + 1) / 2; --k) {
    now = min(now - x, suf[n - k + 1]);
    if (now > 0) {
      printf("%d\n", k);
      return 0;
    }
  }
  puts("-1");
  return 0;
}
