#include <bits/stdc++.h>
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
const double PI = acos(-1), EPS = 1e-7;
const int OO = 0x3f3f3f3f, N = 100000 + 5, mod = 1e9 + 7;
using namespace std;
long long gcd(long long x, long long y) { return (!y) ? x : gcd(y, x % y); }
long long lcm(long long x, long long y) { return ((x / gcd(x, y)) * y); }
void file() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
vector<int> v;
int main() {
  file();
  int n, k;
  cin >> n >> k;
  v = vector<int>(n);
  for (auto &t : v) cin >> t;
  int cnt = 0;
  sort(((v).begin()), ((v).end()));
  v.push_back(2e9);
  for (int i = 0; i < n; i++) {
    auto t = upper_bound(((v).begin()), ((v).end()), v[i]);
    if (*t - v[i] > k) cnt++;
  }
  cout << cnt << '\n';
  return 0;
}
