#include <bits/stdc++.h>
const int maxn = 2e5 + 10;
const int inf = 0x3f3f3f3f;
using namespace std;
int n, k, a[maxn];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  int cnt = 0;
  a[n + 1] = inf;
  for (int i = 1; i <= n - 1; i++) {
    int pos = upper_bound(a + 1, a + 1 + n, a[i]) - a;
    if (a[pos] <= a[i] + k) cnt++;
  }
  cout << n - cnt << endl;
  return 0;
}
