#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 1e18;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  long long ans = n;
  for (int i = 0; i < n; i++) {
    auto it = upper_bound(v.begin(), v.end(), v[i]);
    if (it != v.end() && *it <= v[i] + k) ans--;
  }
  cout << ans << endl;
  return 0;
}
