#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  long long int a[n];
  long long int i = 0;
  while (i < n) {
    cin >> a[i];
    i++;
  }
  sort(a, a + n);
  long long int count = 0;
  vector<long long int> v;
  vector<long long int> v1;
  i = 0;
  while (i < n) {
    count = 1;
    v1.push_back(a[i]);
    while (i < n - 1 and a[i] == a[i + 1]) {
      count++;
      i++;
    }
    v.push_back(count);
    i++;
  }
  i = 1;
  count = 0;
  while (i < v.size()) {
    if (v1[i] > v1[i - 1] and v1[i] - v1[i - 1] <= k) count += v[i - 1];
    i++;
  }
  cout << n - count;
}
