#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
int n, K;
int arr[maxn], val[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> K;
  int res = n;
  for (int i = 1; i <= n; ++i) cin >> arr[i];
  sort(arr + 1, arr + 1 + n);
  int cnt = 1;
  val[1] = 1;
  for (int i = 2; i <= n; ++i) {
    if (arr[i] != arr[i - 1])
      arr[++cnt] = arr[i], val[cnt] = 1;
    else
      ++val[cnt];
  }
  for (int i = 2; i <= cnt; ++i) {
    if (arr[i] <= arr[i - 1] + K) {
      res -= val[i - 1];
    }
  }
  cout << res << endl;
  return 0;
}
