n=input().split(' ')
n2=int(n[1])
a=input().split(' ')
b=[]
d=0
for i in range(len(a)):
    a[i]=int(a[i])
for i in range(len(a)):
    f=1
    l=0
    for h in range(len(a)):
        if a[i]-a[h] > n2 and f==1:
            d=d+1
            f=0
print(d)
