#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n];
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  sort(a, a + n);
  int ct = 0;
  int mrk = 0;
  for (int i = 1; i < n; i++) {
    if (a[i] > a[i - 1] && a[i] <= a[i - 1] + m) {
      ct += mp[a[i - 1]];
    }
  }
  cout << n - ct;
}
