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