#include <bits/stdc++.h>
using namespace std;
bool check(long long n, long long pos) { return n & (1LL << pos); }
long long Set(long long n, long long pos) { return n = n | (1LL << pos); }
struct segTree {
  long long n;
  vector<long long> tree, lazy;
  segTree(long long n) : n(n), tree(4 * n, 0), lazy(4 * n, 0) {}
  void propagate(long long node, long long l, long long r) {
    tree[node] += lazy[node];
    if (l != r) lazy[2 * node] += lazy[node], lazy[2 * node + 1] += lazy[node];
    lazy[node] = 0;
  }
  void treeUpdate(long long node, long long l, long long r, long long u,
                  long long v, long long val) {
    long long mid = (l + r) >> 1;
    propagate(node, l, r);
    if (l > v || r < u) return;
    if (l >= u && r <= v) {
      lazy[node] += val;
      propagate(node, l, r);
      return;
    }
    treeUpdate(2 * node, l, mid, u, v, val);
    treeUpdate(2 * node + 1, mid + 1, r, u, v, val);
    tree[node] = min(tree[2 * node], tree[2 * node + 1]);
  }
  void update(long long l, long long r, long long val) {
    treeUpdate(1, 1, n, l, r, val);
  }
  long long treeQuery(long long node, long long l, long long r, long long u,
                      long long v) {
    long long mid = (l + r) >> 1;
    propagate(node, l, r);
    if (l > v || r < u) return LLONG_MAX;
    if (l >= u && r <= v) return tree[node];
    return min(treeQuery(2 * node, l, mid, u, v),
               treeQuery(2 * node + 1, mid + 1, r, u, v));
  }
  long long query(long long l, long long r) { return treeQuery(1, 1, n, l, r); }
};
long long arr[500005];
int main() {
  long long i, j, k, l, m, n, o, r, q;
  long long testcase;
  long long input, flag, tag, ans;
  while (cin >> n) {
    long long sum = 0;
    for (i = 1; i <= (n + 1) / 2; i++) scanf("%lld", &arr[i]), sum += arr[i];
    cin >> m;
    long long half = ((n + 1) / 2);
    segTree tree(n - half + 1);
    for (i = 1, j = half; j <= n; i++, j++) {
      tree.update(i, i, sum);
      sum -= arr[i];
      sum += m;
    }
    ans = -1;
    long long last = (n - half + 1);
    for (k = half; k <= n; k++) {
      long long ask = tree.query(1, last);
      if (ask > 0) ans = k;
      last--;
      tree.update(1, last, m);
    }
    cout << ans << '\n';
  }
}
