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