#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b) { return a > b; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n, comp);
  int i = 0, ans = 0, pre;
  bool eater = false;
  while (i < n) {
    if (!eater) {
      eater = true;
      pre = arr[i];
      ans++;
      i++;
      continue;
    }
    eater = false;
    while (i < n && arr[i] == pre) ans++, i++;
    while (i < n && pre - k <= arr[i]) pre = arr[i++];
  }
  cout << ans;
}
