#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long mod = 1e9 + 7;
const long long big = 1e18;
const double PI = 2 * asin(1);
long long N, L;
vector<long long> x(100005, big);
long long nexthotel[20][100005];
void prepare() {
  long long index;
  for (long long i = 0; i < N; ++i) {
    index = upper_bound(x.begin(), x.end(), x[i] + L) - x.begin() - 1;
    nexthotel[0][i] = index;
  }
  for (long long i = 1; i < 20; ++i) {
    for (long long j = 0; j < N; ++j) {
      nexthotel[i][j] = nexthotel[i - 1][nexthotel[i - 1][j]];
    }
  }
}
int main() {
  cin >> N;
  for (long long i = 0; i < N; ++i) cin >> x[i];
  cin >> L;
  prepare();
  return 0;
  long long Q;
  cin >> Q;
  long long A, B;
  vector<long long> ans(Q, 0);
  long long tmp;
  long long two;
  for (long long i = 0; i < Q; ++i) {
    cin >> A >> B;
    A--;
    B--;
    if (A > B) swap(A, B);
    while (A < B) {
      tmp = 0;
      two = 1;
      while (nexthotel[tmp + 1][A] <= B) {
        two *= 2;
        tmp++;
      }
      A = nexthotel[tmp][A];
      ans[i] += two;
    }
  }
  for (long long i = 0; i < Q; ++i) cout << ans[i] << endl;
}
