2 1
1 1
 4 1
2 2 1 1
 10 1
2 6 3 4 2 4 4 3 2 1
 2 1
999152 999153
 8 1000000
1 1 5 1000000 1000000 2 2 2
 9 2
1 6 1 5 5 8 6 8 7
 15 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 1 4
8
 10 1
6 3 1 3 6 4 1 3 6 4
 10 1
1 2 3 5 6 8 10 11 9 4
 7 2
1 5 5 8 9 8 8
 2 1000000
1 1000000
 8 2
3 13 9 8 3 13 9 14
 1 1
1
 2 1
1 2

2
 2
 4
 1
 2
 4
 15
 1
 7
 2
 4
 1
 5
 1
 1

#include <bits/stdc++.h>
using namespace std;
int Day12[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int prime100[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29, 31, 37,  41, 43,
                  47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103};
template <typename T>
inline bool isLeap(T y) {
  return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false);
}
template <typename T>
inline T GCD(T a, T b) {
  a = abs(a);
  b = abs(b);
  if (a < b) swap(a, b);
  while (b) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
template <typename T>
inline T LCM(T x, T y) {
  T tp = GCD(x, y);
  if ((x / tp) * 1. * y > 9e18) return 9e18;
  return (x / tp) * y;
}
template <typename T>
inline T BIGMOD(T A, T B, T M = 1000000009) {
  T ret = 1;
  while (B) {
    if (B & 1) ret = (ret * A) % M;
    A = (A * A) % M;
    B = B >> 1;
  }
  return ret;
}
template <typename T>
inline T BigMod(T A, T B, T M) {
  T ret = 1;
  while (B) {
    if (B & 1) ret = (ret * A) % M;
    A = (A * A) % M;
    B = B >> 1;
  }
  return ret;
}
long long int MySqrt(long long int n) {
  long long int p = sqrt(n);
  if ((p + 1) * (p + 1) <= n)
    return p + 1;
  else if (p * p <= n)
    return p;
  else
    return p - 1;
}
long long int MyPow(long long int x, long long int n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return MyPow(x * x, n / 2);
  else
    return x * MyPow(x * x, ((n - 1) / 2));
}
int arr[200005];
int main(int argc, char const *argv[]) {
  int n, k;
  scanf("%d%d", &(n), &(k));
  for (int i = 0; i < n; i++) {
    scanf("%d", &(arr[i]));
  }
  sort(arr, arr + n);
  int i = 0, cnt = 0, same = 0;
  while (i < n) {
    int x = arr[i];
    int now = x + k;
    int pos = n;
    same = 0;
    for (int j = i + 1; j < n; j++) {
      if (x == arr[j]) {
        same++;
        continue;
      } else if (arr[j] <= now && arr[j] > x) {
        same = 0;
        pos = j;
        break;
      } else {
        pos = j;
        cnt++;
        cnt = cnt;
        break;
      }
    }
    cnt = cnt + same;
    i = pos;
  }
  printf("%d\n", cnt + 1);
}
