#include <bits/stdc++.h>
using namespace std;
const int N = 3 + 2e5;
int n, a[N];
int k;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  int last = 1, ans = n;
  for (int i = 2; i <= n; ++i) {
    if (a[i] == a[last]) continue;
    if (a[i] <= a[last] + k) ans -= i - last;
    last = i;
  }
  cout << ans << endl;
  return 0;
}
