#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a;
  int flag = 0;
  for (int i = 0; i < n; i++) {
    int y;
    cin >> y;
    a.push_back(y);
  }
  for (int i = 1; i < n; i++) {
    if (a[i] == a[i - 1]) {
      flag++;
    }
  }
  if (flag == n - 1) {
    cout << n;
    return 0;
  }
  sort(a.begin(), a.end());
  int s = n;
  int j = 0;
  for (int i = 0; i < n; i++) {
    while (a[j] < a[i]) {
      if (a[i] - a[j] <= k) {
        s--;
      }
      j++;
    }
  }
  cout << s;
}
