#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1000000007LL;
const int N = 1e6 + 10;
const long long Inf = 2242545357980376863LL;
const long long Log = 30;
long long a[N], ps[N], second[N], mn[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long m = (n + 1) / 2;
  for (int i = 0; i < m; i++) cin >> a[i];
  long long x;
  cin >> x;
  for (int i = m; i < n; i++) a[i] = x;
  ps[0] = a[0];
  for (int i = 1; i < n; i++) ps[i] = ps[i - 1] + a[i];
  if (ps[n - 1] > 0) return cout << n << '\n', 0;
  int ln = n - m + 1;
  for (int i = 0; i + ln - 1 < n; i++)
    second[i] = a[i] + ps[i + ln - 1] - ps[i];
  mn[0] = second[0];
  for (int i = 1; i < n; i++) mn[i] = min(mn[i - 1], second[i]);
  long long del = 0;
  for (; ln <= n; ln++) {
    if (del + mn[n - ln] > 0) return cout << ln << '\n', 0;
    del += x;
  }
  cout << -1 << '\n';
  return 0;
}
