#include <bits/stdc++.h>
using namespace std;
int n, n1, n2;
long long a[500005];
int g[500005], x;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  n1 = (n + 1) / 2;
  n2 = n - n1;
  for (int i = 1; i <= n1; ++i) cin >> a[i];
  cin >> x;
  for (int i = n1 + 1; i <= n; ++i) a[i] = x;
  for (int i = n; i >= 1; --i) a[i] += a[i + 1];
  if (x >= 0) {
    if (a[1] > 0)
      cout << n;
    else
      cout << -1;
    return 0;
  }
  x = abs(x);
  for (int i = 1; i <= n1; ++i) {
    if (a[i] > 0) {
      g[n1]++;
      g[n - i + 2]--;
      continue;
    }
    long long c = abs(a[i]);
    long long k = c / x + 1;
    c = n - i + 1 - k;
    if (c >= n1) g[n1]++, g[c + 1]--;
  }
  for (int i = 1; i <= n; ++i) g[i] += g[i - 1];
  for (int i = 1; i <= n; ++i)
    if (g[i] == n - i + 1) {
      cout << i;
      return 0;
    }
  cout << -1;
  return 0;
}
