#include <bits/stdc++.h>
using namespace std;
int ar[1000006], a[200005];
int main() {
  int n, K, i, j;
  long long int gb;
  cin >> n >> K;
  memset(ar, 0, sizeof(ar));
  for (i = 0; i < n; i++) {
    cin >> a[i];
    ar[a[i]]++;
  }
  sort(a, a + n);
  gb = 0ll;
  for (i = 1; i < n; i++) {
    j = i - 1;
    if (((a[j] < a[i]) && ((a[j] + K) >= a[i]))) {
      gb += (ar[a[j]]);
    }
  }
  cout << n - gb << endl;
  return 0;
}
