N,K=map(int,input().split())
a=[]
for i in range(N):
    a.append(int(input()))
counter=0
b=a[0]
a.append(1000000)
for i in range(N):
    if abs(b-a[i+1])<K+1:
        b=a[i]
        counter+=1
print(counter+2)
