#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXN = 200005;
int n, k, in[MAXN];
bool check(int id) {
  int v = in[id];
  int tmp = upper_bound(in, in + n + 1, v) - in;
  if (in[tmp] - v <= k) return true;
  return false;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  while (cin >> n >> k) {
    for (int i = 0; i < n; ++i) {
      cin >> in[i];
    }
    sort(in, in + n);
    in[n] = 20000000;
    int ret = 0;
    for (int i = 0; i < n; ++i) {
      if (check(i))
        continue;
      else
        ret++;
    }
    cout << ret << '\n';
  }
  return 0;
}
