#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
int a[200020];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  int num = 0;
  a[n] = 0x3f3f3f3f;
  for (int i = 0; i < n; i++) {
    int x = a[i];
    int y = upper_bound(a, a + n + 1, x) - a;
    if ((a[y] - x) > k) {
      num++;
    }
  }
  cout << num << endl;
}
