#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
void moha() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
const long double eps = 1e-10;
int main() {
  moha();
  int n, k;
  cin >> n >> k;
  int a[n + 1];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int x = n, z = 1;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] < a[i + 1] && a[i] + k >= a[i + 1]) {
      x -= z;
    }
    if (a[i] == a[i + 1]) {
      z++;
    } else {
      z = 1;
    }
  }
  cout << x << endl;
  return 0;
}
