#include <bits/stdc++.h>
using namespace std;
namespace levian {
long long n;
long long x;
long long a[500100];
long long ps[500100];
vector<pair<long long, long long> > work;
pair<long long, long long> llersect(pair<long long, long long> &p1,
                                    pair<long long, long long> &p2);
bool empty(pair<long long, long long> &p) { return (p.first > p.second); }
void getWork(long long i) {
  long long cut = ps[i] - a[i];
  pair<long long, long long> acc = {(n + 2) / 2, n + 1};
  if (x > 0) {
    if (ps[n / 2] > cut) {
      pair<long long, long long> pos = {n / 2 - i + 1, n + 1};
      pos = llersect(pos, acc);
      work.push_back(pos);
      return;
    }
    long long t = 1 + (cut - ps[n / 2]) / x;
    pair<long long, long long> pos = {min(n + 1 - i, n / 2 + t - i + 1), n + 1};
    pos = llersect(pos, acc);
    work.push_back(pos);
    return;
  }
  if (x == 0) {
    if (ps[n / 2] > cut) {
      pair<long long, long long> pos = {n / 2 - i + 1, n + 1};
      pos = llersect(pos, acc);
      work.push_back(pos);
      return;
    } else {
      work.push_back({n - i + 1, n + 1});
      return;
    }
  }
  if (ps[n - 1] > cut) {
    pair<long long, long long> pos = {n / 2 - i + 1, n + 1};
    pos = llersect(pos, acc);
    work.push_back(pos);
    return;
  }
  long long t = 1 + (cut - ps[n - 1]) / (-x);
  pair<long long, long long> pos = {n / 2 - i + 1, n - i - t};
  pos = llersect(pos, acc);
  work.push_back(pos);
}
pair<long long, long long> llersect(pair<long long, long long> &p1,
                                    pair<long long, long long> &p2) {
  return {max(p1.first, p2.first), min(p1.second, p2.second)};
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 0; i < (n + 1) / 2; i++) {
    cin >> a[i];
  }
  cin >> x;
  for (long long i = (n + 1) / 2; i < n; i++) {
    a[i] = x;
  }
  ps[0] = a[0];
  for (long long i = 0; i < n; i++) {
    ps[i + 1] = ps[i] + a[i + 1];
  }
  for (long long i = 0; i <= (n - 1) / 2; i++) {
    getWork(i);
  }
  pair<long long, long long> pr = {-1, 1000000};
  long long k = -1;
  for (long long i = 0; i <= (n - 1) / 2; i++) {
    pr = llersect(pr, work[i]);
    if (pr.first == (n + 1)) {
      break;
    }
    if (!empty(pr)) {
      if (pr.second == n + 1) {
        k = n;
        break;
      }
      if (pr.second >= n - i) {
        k = pr.second;
        break;
      }
      continue;
    }
    break;
  }
  cout << k << endl;
  return 0;
}
}  // namespace levian
int main() {
  levian::main();
  return 0;
}
