#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long N, S, X, sum = 0, ans = -1;
  cin >> N;
  S = (N + 1) / 2;
  vector<long long> arr(S + 1), post(S + 2), minv(S + 2, LLONG_MAX);
  for (long long i = 1; i <= S; ++i) {
    cin >> arr[i];
  }
  cin >> X;
  for (long long i = S; i > 0; --i) {
    post[i] = post[i + 1] + (arr[i] - X);
  }
  for (long long i = 1; i <= S; ++i) {
    minv[i] = min(minv[i - 1], post[i]);
  }
  minv[0] = 0;
  post[1] = 0;
  for (long long i = S; i >= 0; --i) {
    if ((N - S) * X + sum > 0 &&
        (minv[i] - post[i + 1]) + (N - S) * X + sum > 0 && N - i >= S) {
      ans = (N - S) + (S - i);
      break;
    }
    sum += arr[i];
  }
  cout << ans << endl;
  return 0;
}
