#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double pi = acos(-1), eps = 1e-8;
const int maxn = 1 << 17;
const int N = 2e6 + 10, M = 2e7 + 10, mod = 1e9 + 7;
int n, m, x;
int a[N];
long long s[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n / 2 + n % 2; i++) {
    scanf("%d", &a[i]);
  }
  scanf("%d", &x);
  for (int i = 1; i <= n; i++) {
    if (i > n / 2 + n % 2) a[i] = x;
    s[i] = s[i - 1] + a[i];
  }
  long long mn = s[n];
  if (mn > 0) {
    printf("%d\n", n);
    return 0;
  }
  for (int i = 2; i <= n / 2 + n % 2; i++) {
    mn = min(mn - x, s[n] - s[i - 1]);
    if (mn > 0) {
      printf("%d\n", n - i + 1);
      return 0;
    }
  }
  printf("-1");
  return 0;
}
