#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n + 1];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int cnt = 0, j = 0;
  a[n] = int(2e9);
  for (int i = 0; i < n; i++) {
    while (j < n && a[j] == a[i]) ++j;
    if (a[j] - a[i] > k) ++cnt;
  }
  cout << cnt;
  return 0;
}
