#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  long long M = (N + 1) / 2;
  vector<long long> A(M);
  long long All = 0;
  for (int i = 0; i < M; i++) {
    cin >> A[i];
    All += A[i];
  }
  long long X;
  cin >> X;
  All += X * (N - M);
  if (All > 0)
    cout << N << "\n";
  else {
    if (X >= 0) {
      cout << -1 << "\n";
    } else {
      long long mini = 0;
      for (int i = 0; i < M; i++) {
        All -= A[i];
        mini = min(A[i] - X + mini, A[i] - X);
        if (min(All, All + mini) > 0) {
          cout << N - i - 1 << "\n";
          return 0;
        }
      }
      cout << -1 << "\n";
    }
  }
  return 0;
}
