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

from math import *
from sys import stdin, stdout
coder = "sdpt"


n,k=list(map(int,stdin.readline().split()))
a = list(map(int,stdin.readline().split()))

a.sort()
c = 0
out = []
for i in range(n-1):
    if (a[i+1]>a[i] ) and a[i+1]-a[i]<=k :
        c+=1
    else:
        j = i+1
        found = 0;
        while(j<n):
            if a[j]-a[i] <= k:
                found =1
            else:
                break
            j+=1
        if(found == 1):
            c+=1

print(n-c)


# from math import *
# from sys import stdin, stdout
# coder = "sdpt"
#
# def cin():
#     return list(map(int,stdin.readline().split()))
#
# for _ in range(int(input())):
#     arr = list(map(float,stdin.readline().split()))
#
#     p = arr[:3]
#     q = arr[3:6]
#     d = arr[6:9]
#     c = arr[9:12]
#     r = arr[12]
#     m = [0] * 3
#     n = [0] * 3
#     for i in range(3):
#         m[i] = c[i] - p[i]
#         n[i] = q[i] - p[i]
#     w = [0] * 3
#     x = [0] * 3
#     SumWsq = 0
#     Sum2WX = 0
#     SumXsq = 0
#     SumNsq = 0
#     Sum2ND = 0
#     SumDsq = 0
#
#     rsq = r * r
#     for i in range(3):
#         j = (i + 1) % 3
#         k = (i + 2) % 3
#         w[i] = m[j] * n[k] - m[k] * n[j]
#         x[i] = m[j] * d[k] - m[k] * d[j]
#
#         SumWsq += w[i] * w[i]
#         Sum2WX += 2 * w[i] * x[i]
#         SumXsq += x[i] * x[i]
#
#         SumNsq += n[i] * n[i] * rsq
#         SumDsq += d[i] * d[i] * rsq
#         Sum2ND += 2 * d[i] * n[i] * rsq
#
#     A = SumXsq - SumDsq
#     B = Sum2WX - Sum2ND
#     C = SumWsq - SumNsq
#
#     if A == 0:
#         ans = -C / B
#         print("%.8f" % ans)
#     else:
#         ans = (-B + sqrt(B * B - 4 * A * C)) / (2 * A)
#         print("%.8f" % ans)