#include <bits/stdc++.h>
using namespace std;
const int maxn = 500010;
const int INF = 2000000010;
int n, m, k, t, x;
long long a[maxn], num[maxn], sum[maxn], mi[maxn];
int main() {
  scanf("%d", &n);
  m = (n + 1) / 2;
  for (int i = 1; i <= m; i++) scanf("%lld", &a[i]);
  scanf("%d", &x);
  for (int i = m + 1; i <= n; i++) a[i] = x;
  for (int i = 1; i <= n; i++) num[i] = num[i - 1] + a[i];
  for (int i = 1; i <= m; i++)
    sum[i] = sum[i - 1] + x - a[i], mi[i] = min(mi[i - 1], sum[i]);
  for (int i = m; i <= n; i++) {
    if (num[i] + mi[n - i] > 0) {
      printf("%d\n", i);
      return 0;
    }
  }
  puts("-1");
  return 0;
}
