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>
using namespace std;
int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
pair<pair<int, int>, pair<int, int> > intersect(pair<int, int> f1,
                                                pair<int, int> f2,
                                                pair<int, int> s1,
                                                pair<int, int> s2) {
  int x5, y5, x6, y6;
  x5 = max(min(f1.first, f2.first), min(s1.first, s2.first));
  x6 = min(max(f1.first, f2.first), max(s1.first, s2.first));
  y5 = max(min(f1.second, f2.second), min(s1.second, s2.second));
  y6 = min(max(f1.second, f2.second), max(s1.second, s2.second));
  if (x5 >= x6 || y5 >= y6) {
    return {{0, 0}, {0, 0}};
  }
  return {{x5, y5}, {x6, y6}};
}
template <class T, class V>
int min(T a, V b) {
  return min((int)a, (int)b);
}
template <class T, class V>
int max(T a, V b) {
  return max((int)a, (int)b);
}
bool isPrime(long long n, long long p) {
  if (n < 2) return 0;
  for (long long i = 2; i * i <= n; i++) {
    if (i > p) break;
    if (n % i == 0) return 0;
  }
  return 1;
}
void faster() {
  if (0) {
    freopen(
        "taskA"
        ".in",
        "r", stdin);
    freopen(
        "taskA"
        ".out",
        "w", stdout);
  }
  if (1) {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  }
}
const long long INF = 1e18;
const int inf = 1e9;
const int MAXN = (int)2e5 + 123;
const int MOD = (int)1e9 + 7;
const long double PI = acos(-1);
const long double EPS = 3E-16;
namespace MATH_CAL {
const int mod = MOD;
inline long long add(long long a, long long b) {
  return a + b >= mod ? a + b - mod : a + b;
}
inline long long sub(long long a, long long b) {
  return a - b < 0 ? a - b + mod : a - b;
}
inline long long mul(long long a, long long b) {
  return (long long)a * b % mod;
}
inline void Add(long long &a, long long b) { (a += b) >= mod ? a -= mod : 0; }
inline void Sub(long long &a, long long b) { (a -= b) < 0 ? a += mod : 0; }
inline long long qpow(long long first, long long n) {
  long long r = 1;
  for (; n; n /= 2, first = mul(first, first))
    if (n & 1) r = mul(r, first);
  return r;
}
inline long long mod_inv(long long first) { return qpow(first, mod - 2); }
inline long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
}  // namespace MATH_CAL
using namespace MATH_CAL;
void solve() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  int ans = n;
  for (int i = 0; i < n; i++) {
    int item = a[i];
    auto gr = upper_bound(a.begin() + i + 1, a.end(), item);
    if (gr != a.end()) {
      if (*gr <= item + k) {
        ans--;
      }
    }
  }
  cout << ans << endl;
}
int main() {
  faster();
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
