N,K=map(int,input().split())
A=[]
ls=[]
for i in range(N):
    A.append(int(input()))

def count(list):
    pre = list[0]
    ls.clear()
    for i in range(1,len(list)):
        if abs(pre-list[i]) <= K:
            pre = list[i]
        else:
            ls.append(list[i])
    #print(list,ls)

count(A)
while 1:
    if len(A)-len(ls) >= len(ls):
        print(len(A)-len(ls))
        break
    else:
        A = ls
        count(A)
