#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  int c = 0;
  for (int i = 0; i < n - 1; ++i) {
    int index1 = upper_bound(v.begin(), v.end(), v[i]) - v.begin();
    int index2 = lower_bound(v.begin(), v.end(), v[i] + k) - v.begin();
    if (index1 == n)
      continue;
    else {
      if (index2 == n)
        c++;
      else {
        if (v[index2] == (v[i] + k))
          c++;
        else if ((index2 - 1) != i && v[index2 - 1] > v[i])
          c++;
      }
    }
  }
  printf("%d", n - c);
  return 0;
}
