#include <bits/stdc++.h>
using namespace std;
int arr[200000 + 10];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  int ans = n;
  for (int i = 1; i < n; i++) {
    for (int j = i - 1; j >= 0; j--) {
      if (arr[j] == -1) {
        break;
      }
      if (arr[i] > arr[j] && arr[j] + k >= arr[i]) {
        ans--;
        arr[j] = -1;
      } else
        break;
    }
  }
  cout << ans;
  return 0;
}
