2 1
1 1
 4 1
2 2 1 1
 10 1
2 6 3 4 2 4 4 3 2 1
 2 1
999152 999153
 8 1000000
1 1 5 1000000 1000000 2 2 2
 9 2
1 6 1 5 5 8 6 8 7
 15 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 1 4
8
 10 1
6 3 1 3 6 4 1 3 6 4
 10 1
1 2 3 5 6 8 10 11 9 4
 7 2
1 5 5 8 9 8 8
 2 1000000
1 1000000
 8 2
3 13 9 8 3 13 9 14
 1 1
1
 2 1
1 2

2
 2
 4
 1
 2
 4
 15
 1
 7
 2
 4
 1
 5
 1
 1

#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:10000000000")
using namespace std;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template <typename T>
ostream& operator<<(ostream& o, vector<T> x) {
  for (auto it : x) o << it << ' ';
  return o;
}
template <typename T>
istream& operator>>(istream& i, vector<T>& x) {
  for (auto& it : x) i >> it;
  return i;
}
template <typename T1, typename T2>
void chkmin(T1& a, T2 b) {
  a > b ? a = b : 0;
}
template <typename T1, typename T2>
void chkmax(T1& a, T2 b) {
  a < b ? a = b : 0;
}
const long long INF = 1000000007;
const long long INF2 = 100000000000000007;
const long long mINF = 1e16;
const long long MOD1 = 998244353;
const long long MOD = 1000000007;
const long long SIZE = 500010;
const long long base = 53;
const long double eps = 1e-6;
const long double pi = acosl(-1.0);
long long add(long long a, long long b) { return ((a + b) % MOD + MOD) % MOD; }
long long mult(long long a, long long b) { return (a * b) % MOD; }
long long binpow(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = mult(res, a);
    a = mult(a, a);
    n >>= 1;
  }
  return res;
}
long long binpow1(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) {
      res *= a;
    }
    a *= a;
    n >>= 1;
  }
  return res;
}
long long inv(long long a) { return binpow(a, MOD - 2); }
long long del(long long a, long long b) { return mult(a, inv(b)); }
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <typename T>
T sqr(T x) {
  return x * x;
}
long long n, k, a, rs;
map<long long, long long> cnt;
vector<long long> kek;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  rs = n;
  for (long long i = 0; i < n; ++i) {
    cin >> a;
    if (cnt.find(a) == cnt.end()) kek.push_back(a);
    cnt[a]++;
  }
  sort(kek.begin(), kek.end());
  for (long long i = 1; i < kek.size(); ++i) {
    if (kek[i] <= kek[i - 1] + k) {
      rs -= cnt[kek[i - 1]];
    }
  }
  cout << rs;
  return 0;
}
