#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t, n, k, c = 0, d = 0;
  cin >> n >> k;
  map<long long, long long> m;
  for (int i = 0; i < n; ++i) {
    cin >> t;
    m[t]++;
  }
  auto it2 = m.begin();
  for (auto it = m.begin(); it != m.end(); ++it) {
    it2 = it;
    it2++;
    t = it->first;
    if (it2 == m.end()) {
      c += it->second;
      break;
    }
    d = it2->first;
    if (t + k < d) c += it->second;
  }
  cout << c;
  return 0;
}
