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;
const long long int mod = 1000000007LL;
const long long int big = 2.19e15 + 1;
const long double pai = 3.141592653589793238462643383279502884197;
const long double eps = 1e-15;
template <class T, class U>
void mineq(T& a, U b) {
  if (a > b) {
    a = b;
  }
}
template <class T, class U>
void maxeq(T& a, U b) {
  if (a < b) {
    a = b;
  }
}
long long int gcd(long long int a, long long int b) {
  if (a % b == 0) {
    return b;
  } else
    return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
template <class T>
void SO(T& ve) {
  sort(ve.begin(), ve.end());
}
template <class T>
void REV(T& ve) {
  reverse(ve.begin(), ve.end());
}
long long int LBI(vector<int>& ar, int in) {
  return lower_bound(ar.begin(), ar.end(), in) - ar.begin();
}
long long int UBI(vector<int>& ar, int in) {
  return upper_bound(ar.begin(), ar.end(), in) - ar.begin();
}
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long int i, ans = 0, gen = 0, now = 0, n, K, mae = -mod;
  cin >> n >> K;
  vector<long long int> a(n);
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  SO(a);
  for (i = 0; i < n; i++) {
    now++;
    if (mae + K < a[i]) {
      ans += now;
      now = 0;
    }
    if (mae < a[i]) {
      now = 0;
    }
    mae = a[i];
  }
  cout << ans << endl;
  return 0;
}
