#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
const long long INF = (1LL << 60) - 1;
int a[N];
long long sum[N];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= (n + 1) / 2; i++) cin >> a[i];
  int x;
  cin >> x;
  for (int i = (n + 1) / 2 + 1; i <= n; i++) a[i] = x;
  for (int i = n; i >= 1; i--) sum[i] = sum[i + 1] + a[i];
  long long now = INF;
  for (int k = n; k > -1; k--) {
    now = min(now - x, sum[n - k + 1]);
    if (now > 0) {
      cout << k << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
  return 0;
}
