#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long *a = new long long[n];
  long long i, j;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long count = n;
  for (i = 0; i < n - 1; i++) {
    if (a[i] != a[i + 1] && a[i] + k >= a[i + 1]) {
      long long temp = i;
      while (temp >= 0 && a[temp] == a[i]) count--, temp--;
    }
  }
  cout << count;
}
