#include <bits/stdc++.h>
using namespace std;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (upper_bound(a.begin(), a.end(), a[i]) != a.end()) {
      int r = (upper_bound(a.begin(), a.end(), a[i])) - a.begin();
      if (a[r] > a[i] + k) cnt++;
    } else {
      cnt++;
    }
  }
  cout << cnt;
  return 0;
}
