#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 5;
int a[MAXN], mx[MAXN];
long long pre[MAXN];
long long calc(int i, int len) { return pre[i + len - 1] - pre[i - 1]; }
int main() {
  int n, x;
  scanf("%d", &n);
  for (int i = 1; i <= (n + 1) / 2; i++) scanf("%d", &a[i]);
  scanf("%d", &x);
  for (int i = (n + 1) / 2 + 1; i <= n; i++) a[i] = x;
  for (int i = 1; i <= n; i++) pre[i] = pre[i - 1] + a[i];
  if (pre[n] > 0)
    return 0 * printf("%d\n", n);
  else if (x >= 0)
    return 0 * puts("-1");
  for (int i = 1; i <= (n + 1) / 2; i++) {
    int L = (n + 1) / 2, R = n + 1 - i;
    while (L <= R) {
      int mid = (L + R) >> 1;
      if (calc(i, mid) > 0) {
        L = mid + 1;
        mx[i] = mid;
      } else {
        R = mid - 1;
      }
    }
  }
  int mi = 1e9;
  for (int i = n; i >= (n + 1) / 2; i--) {
    mi = min(mi, mx[n + 1 - i]);
    if (mi >= i) return 0 * printf("%d\n", i);
  }
  puts("-1");
  return 0;
}
