#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000005;
int main() {
  int n, k, x, a[maxn], book[maxn];
  while (scanf("%d %d", &n, &k) != EOF) {
    memset(a, 0, sizeof(a));
    memset(book, 0, sizeof(book));
    int ans = n, cnt = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &x);
      if (!book[x]) a[cnt++] = x;
      book[x]++;
    }
    sort(a, a + cnt);
    for (int i = 1; i < cnt; i++) {
      if (a[i] - a[i - 1] <= k) ans = ans - book[a[i - 1]];
    }
    printf("%d\n", ans);
  }
  return 0;
}
