#include <bits/stdc++.h>
using namespace std;
long long n, k, arr[200009];
bool done[200009];
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  for (int i = 0; i < n; i++) {
    int l = i, r = n;
    while (r - l > 1) {
      int m = (l + r) / 2;
      if (arr[m] > arr[i] && arr[m] <= arr[i] + k) {
        done[i] = 1;
        break;
      }
      if (arr[m] > arr[i])
        r = m;
      else
        l = m;
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (done[i] == 0) {
      ans++;
    }
  }
  cout << ans << endl;
  exit(0);
}
