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