#include <bits/stdc++.h>
using namespace std;
int a[200005], done[200005] = {0};
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  int ans = 0, i, j, pos;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (i = 0; i < n; i++) {
    for (j = i - 1; j >= 0 && a[j] != 0; j--) {
      if (a[i] > a[j] && a[i] <= a[j] + k) {
        a[j] = 0;
      } else {
        break;
      }
    }
  }
  for (i = 0; i < n; i++) {
    if (a[i]) ans++;
  }
  cout << ans;
  return 0;
}
