#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0l);
const long long MOD = 1e9 + 7;
bool debug = 1;
const int N = -1;
int main() {
  long long n, k;
  cin >> n >> k;
  multiset<long long> s;
  for (int i = 0; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    s.insert(x);
  }
  for (auto it = s.begin(); it != s.end();) {
    long long cand = *(--s.upper_bound(*it + k));
    if (cand > *it and cand <= *it + k)
      it = s.erase(it);
    else
      it++;
  }
  cout << s.size() << endl;
  return 0;
}
