#include <bits/stdc++.h>
using namespace std;
double const EPS = 1.0E-9;
int const MOD = (int)1e9 + 7;
inline void read(int &x) { scanf("%d", &(x)); }
inline void read(long long &x) { scanf("%lld", &x); }
inline void read(double &x) { scanf("%lf", &x); }
inline long long gcd(long long x, long long y) {
  return y == 0 ? x : gcd(y, x % y);
}
inline long long lcm(long long x, long long y) {
  return x == 0 && y == 0 ? 0 : x / gcd(x, y) * y;
}
inline long long powmod(long long x, long long n, long long m = MOD) {
  long long r = 1;
  while (n) {
    if (n & 1) r = (r * x) % m;
    x = (x * x) % m;
    n /= 2;
  }
  return r;
}
int leap(int y) { return y % 4 == 0 && y % 100 != 0 || y % 400 == 0; }
int const month[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
                          {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
int const MAXN = 1 << 17;
int const MAXV = 26 * 2 + 10 + 1;
int solve() {
  std::map<int, int> mp;
  int n, d;
  read(n);
  read(d);
  for (int i = 0; i < n; ++i) {
    int a;
    read(a);
    ++mp[a];
  }
  int ans = 0;
  for (auto it = mp.begin(), it_e = mp.end(); it != it_e; ++it) {
    auto it_next = std::next(it);
    if (it_next == it_e) {
      ans += (*it).second;
    } else {
      int cur_a = (*it).first;
      int next_a = (*it_next).first;
      if (next_a <= cur_a + d) {
      } else {
        ans += (*it).second;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
int main(int argc, char *argv[]) {
  solve();
  return 0;
}
