n,d= input().split(); n,d= int(n),int(d)
vox= list(i for i in map(int, input().split()))
minpos= min(vox)
j=0
for i in vox:
    if i!=minpos and abs(i-minpos)>d:
        j+=1
        #print(i)
        
print(j)    
