#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int N = 5e5 + 5;
LL a[N], s[N], m[N];
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(NULL);
  int n;
  cin >> n;
  int n2 = (n + 1) >> 1;
  for (int i = 1; i <= n2; ++i) {
    cin >> a[i];
    s[i] = s[i - 1] + a[i];
  }
  LL x;
  cin >> x;
  for (int i = n2 + 1; i <= n; ++i) {
    a[i] = x;
    s[i] = s[i - 1] + x;
  }
  for (int i = 1; i <= n2; ++i) {
    m[i + 1] = min(m[i], x * i - s[i]);
  }
  for (int k = n2; k <= n; ++k) {
    if (s[k] + m[n - k + 1] > 0) {
      cout << k << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
