n,k=map(int,input().split())
l=[]
for i in range(n):
  x=int(input())
  l.append(x)
w=[]
for i in range(0,n):
  for j in range(i+1,n):
    if l[i]-l[j]>=k:
      if l[i] not in w:
        w.append(l[i])
      if l[j] not in w:
        w.append(l[j])
print(len(w))