#include <bits/stdc++.h>
using namespace std;
int m[200001], k, cd;
int val[2000001];
void inp() {
  cin >> cd >> k;
  for (int i = 1; i <= cd; i++) {
    cin >> m[i];
    val[m[i]]++;
  }
  sort(m + 1, m + 1 + cd);
}
bool check(int i) {
  if (m[i] <= m[i - 1] + k && m[i] > m[i - 1]) return true;
  return false;
}
void calc() {
  int kq = cd;
  for (int i = 2; i <= cd; i++) {
    if (check(i)) kq -= val[m[i - 1]];
  }
  cout << kq << endl;
}
int main() {
  inp();
  calc();
}
