#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<int> v;
  vector<int>::iterator up;
  long long i;
  for (i = 0; i < n; i++) {
    long long a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  long long count = n;
  for (i = 0; i < n; i++) {
    up = upper_bound(v.begin(), v.end(), v[i]);
    if (up != v.end() && v[up - v.begin()] <= v[i] + k) {
      count--;
    }
  }
  cout << count << endl;
}
