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