#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  void solve(int num, std::istream& in, std::ostream& out) {
    int n, k;
    in >> n >> k;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) {
      in >> arr[i];
    }
    sort(arr.begin(), arr.end());
    int count = 0;
    for (auto x : arr) {
      int lo = x, hi = x + k;
      auto itLo = upper_bound(arr.begin(), arr.end(), lo);
      if (itLo == arr.end())
        count++;
      else if (*itLo > hi)
        count++;
    }
    out << count;
  }
};
void solve(std::istream& in, std::ostream& out) {
  out << std::setprecision(12);
  Solution solution;
  solution.solve(0, in, out);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  istream& in = cin;
  ostream& out = cout;
  solve(in, out);
  return 0;
}
