#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[200007];
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int acc = 1, cnt = 0;
  for (int i = 1; i < n; i++) {
    if (a[i] > a[i - 1]) {
      if (a[i] <= a[i - 1] + k) cnt += acc;
      acc = 1;
    } else
      acc++;
  }
  cout << n - cnt << endl;
  return 0;
}
