#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[(n + 1) / 2];
  for (int i = 0, ggdem = (n + 1) / 2; i < ggdem; ++i) {
    cin >> a[i];
  }
  long long x;
  cin >> x;
  if (x > 0) {
    long long s = 0;
    for (int i = 0, ggdem = (n + 1) / 2; i < ggdem; ++i) s += a[i];
    s += (n / 2) * x;
    if (s > 0) {
      cout << n;
    } else {
      cout << -1;
    }
    return 0;
  }
  long long d[(n + 1) / 2 + 1];
  d[0] = 0;
  for (int i = 0, ggdem = (n + 1) / 2; i < ggdem; ++i) {
    d[i + 1] = d[i] + x - a[i];
  }
  long long m[(n + 1) / 2 + 1];
  m[0] = 0;
  for (int i = 0, ggdem = (n + 1) / 2; i < ggdem; ++i) {
    m[i + 1] = min(m[i], d[i + 1]);
  }
  long long s = 0;
  for (int i = 0, ggdem = (n + 1) / 2; i < ggdem; ++i) s += a[i];
  for (int i = 0, ggdem = n / 2 + 1; i < ggdem; ++i) {
    if (s + m[n - ((n + 1) / 2 + i)] > 0) {
      cout << (n + 1) / 2 + i;
      return 0;
    }
    s += x;
  }
  cout << -1;
  return 0;
}
