#include <bits/stdc++.h>
using namespace std;
int n, k, cnt, ans, a[200010];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i)
    if (a[i] == a[i - 1])
      ++cnt;
    else if (a[i] <= a[i - 1] + k)
      cnt = 1;
    else
      ans += cnt, cnt = 1;
  printf("%d\n", ans + cnt);
  return 0;
}
