#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, k, count = 0;
  cin >> n >> k;
  vector<long> v;
  for (int i = 0; i < n; i++) {
    long x;
    cin >> x;
    v.push_back(x);
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    long long up = upper_bound(v.begin(), v.end(), v[i] + k) - v.begin() - 1;
    if (v[up] != v[i]) count++;
  }
  cout << v.size() - count << endl;
  return 0;
}
