#include <bits/stdc++.h>
using namespace std;
int bs(vector<int> &lb, int i, int s) {
  int l = i;
  int h = (int)lb.size() - 1;
  while (l <= h) {
    int mid = (l + h) / 2;
    if (lb[mid] < s) {
      l = mid + 1;
    } else {
      h = mid - 1;
    }
  }
  return l;
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> items(n);
  for (int i = 0; i < n; i++) {
    cin >> items[i];
  }
  sort(items.begin(), items.end());
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int res = bs(items, i + 1, items[i] + 1);
    if (res != n && items[res] <= items[i] + k) {
      cnt++;
    }
  }
  cout << n - cnt << endl;
  int pause;
  cin >> pause;
  return 0;
}
