#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int a[maxn];
int n, k;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  int num = 0;
  for (int i = 1; i < n; i++) {
    if (a[i] == a[n]) break;
    int x = upper_bound(a + 1, a + 1 + n, a[i]) - a;
    if (a[i] + k >= a[x]) num++;
  }
  printf("%d\n", n - num);
  return 0;
}
