#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, t;
  cin >> n >> k;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    cin >> t;
    v.push_back(t);
  }
  sort(v.begin(), v.end());
  int count = 0, add = 1;
  for (int i = 1; i < n; i++) {
    if (v[i] > v[i - 1] && v[i] <= v[i - 1] + k) {
      count += add;
      add = 1;
    } else if (v[i] == v[i - 1])
      add++;
    else
      add = 1;
  }
  cout << n - count;
  return 0;
}
