#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < (n + 1) / 2; i++) cin >> a[i];
  cin >> a[(n + 1) / 2];
  for (long long i = (n + 1) / 2 + 1; i < n; i++) {
    a[i] = a[i - 1];
  }
  vector<long long> dp(n, 0);
  dp[0] = a[0];
  for (long long i = 1; i < n; i++) {
    dp[i] += dp[i - 1] + a[i];
  }
  long long k = 1;
  bool was = 1;
  while (was) {
    was = 0;
    for (long long i = 0; i < n; i++) {
      long long x = 0;
      if (i > 0) x = dp[i - 1];
      bool was1 = 1;
      while (was1) {
        if (k > n - i) break;
        was1 = 0;
        if (dp[i + k - 1] - x <= 0) {
          k++;
          if (k > n) {
            cout << -1;
            return 0;
          }
          was1 = 1;
          was = 1;
        }
      }
    }
  }
  cout << k;
}
