#include <bits/stdc++.h>
using namespace std;
char buf[33554432], *s = buf;
template <class T>
inline T rd() {
  if (s == buf + (33554432)) s = buf;
  if (s == buf) fread(s, 1, 33554432, stdin);
  register T x = 0, f = 1;
  while (!isdigit(*s)) {
    if (*s == '-') f = -1;
    ++s;
  }
  while (isdigit(*s)) x = x * 10 + *s++ - 48;
  return x * f;
}
template <class T>
inline void wt(T& x) {
  static char s[20];
  int cnt = 0;
  do s[cnt++] = x % 10;
  while (x /= 10);
  while (cnt--) putchar(s[cnt] + 48);
  putchar('\n');
}
int n = rd<int>(), d = rd<int>(), ans;
pair<int, int> nd[(105)];
int main() {
  register int i = 1;
  for (; i <= n; ++i) nd[i] = {rd<int>(), i};
  sort(nd + 1, nd + n + 1);
  for (i = n; i; --i) {
    if (nd[1].first + d < nd[i].first) ++ans;
  }
  wt(ans);
}
