#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int num[MAXN];
bool mark[MAXN];
bool comp(int a, int b) { return a > b; }
int main(void) {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> num[i];
  sort(num + 1, num + n + 1, comp);
  int ans = n;
  for (int i = n - 1; i >= 1; i--) {
    if (num[i] == num[i + 1]) continue;
    int j;
    for (j = i + 1; j <= n && num[i] - num[j] <= k && !mark[j]; j++)
      ans--, mark[j] = 1;
  }
  cout << ans << "\n";
}
