#include <bits/stdc++.h>
#pragma GCC optimize(2)
const double esp = 1e-6;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int inf = 1e9;
using namespace std;
long long read() {
  char ch = getchar();
  long long x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int N = 5e5 + 10;
long long a[N];
int n;
long long suf[N];
long long dis[N];
int main() {
  n = read();
  int mid = ceil(n / 2.0);
  for (int i = 1; i <= mid; i++) a[i] = read();
  long long x;
  x = read();
  for (int i = mid + 1; i <= n; i++) a[i] = x;
  if (x >= 0) {
    long long sum = 0;
    for (int i = 1; i <= n; i++) sum += a[i];
    if (sum > 0) {
      printf("%d\n", n);
    } else
      printf("-1\n");
  } else {
    int flag = 1;
    for (int i = mid; i >= 1; i--) {
      suf[i] = suf[i + 1] + a[i];
      if (suf[i] < 0) flag = 0;
    }
    {
      long long temp_x = -x;
      for (int i = mid; i >= 1; i--) {
        dis[i] = suf[i] / temp_x;
        if (suf[i] % temp_x == 0) dis[i]--;
      }
      long long ans_pos = 1;
      long long minn = n + 1;
      for (int i = 1; i <= mid; i++) {
        minn = min(dis[i] + mid - i + 1, minn);
        if (i + minn - 1 >= n) {
          printf("%d\n", n - i + 1);
          return 0;
        }
      }
      cout << -1 << endl;
    }
  }
  return 0;
}
