import collections
n,k = map(int,input().split())
ls = [int(input()) for i in range(n)]
p = 0
al = []
for i in range(n):
    p += i
    for j in range(p+1,n):
        if abs(ls[p]-ls[j]) <= k:
            al.append(ls[p])
            al.append(ls[j])
            p = j-i-1
            break
            
c = collections.Counter(al)
print(len(c))