#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, a[500005], x;
  cin >> n;
  for (int i = 0; i < (n + 1) / 2; ++i) cin >> a[i];
  cin >> x;
  if (x <= 0) {
    long long sum = n / 2 * x, all_sum = n / 2 * x, size, i = (n + 1) / 2 - 1;
    for (; i >= 0; --i) {
      all_sum += a[i];
      if (sum <= 0) {
        sum += a[i];
        if (sum > 0) size = (n + 1) / 2 + (n / 2 - i);
      } else {
        sum += a[i] - x;
        if (sum <= 0) sum = all_sum;
      }
    }
    if (sum > 0)
      cout << size << "\n";
    else
      cout << "-1\n";
  }
  if (x > 0) {
    long long sum = n / 2 * x;
    for (int i = 0; i < (n + 1) / 2; ++i) sum += a[i];
    if (sum > 0)
      cout << n << "\n";
    else
      cout << "-1\n";
  }
  return 0;
}
