N,K = map(int,input().split())
A = [0]*N
for i in range(N):
    A[i] = int(input())
length = 1
num = A[0]
for i in range(1,N):
    if num+K>=A[i] and num-K<=A[i]:
        length += 1
        num = A[i]
    
print(length)