#include <bits/stdc++.h>
using namespace std;
const long double M = 144115188075855872;
long long a[200100];
int main() {
  long long n, k, t = 0;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  t = n;
  long long q = 0;
  for (long long i = 1; i < n; i++) {
    if (a[i] == a[i - 1]) {
      q++;
      continue;
    }
    if (a[i] > a[i - 1] && a[i] <= a[i - 1] + k) {
      q++;
      t -= q;
    }
    q = 0;
  }
  cout << t;
}
