#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d;
  scanf("%d", &n);
  ;
  scanf("%d", &d);
  ;
  map<int, int> mark;
  vector<int> v(n);
  for (int x = 0; x < n; x++) scanf("%d", &v[x]);
  ;
  sort(v.begin(), v.end());
  for (int x = 0; x < n; x++) {
    for (int y = x; y < n; y++) {
      if (v[y] - v[x] > d) {
        int chk1 = n - y, chk2;
        for (chk2 = x; chk2 <= y and (v[y] - v[chk2] > d); chk2++)
          ;
        if (chk1 < chk2) {
          for (int z = y; z < n; z++) mark[z] = 1;
        } else {
          for (int z = x; z < chk2; z++) mark[z] = 1;
        }
      }
    }
  }
  printf("%d", (int)mark.size());
}
