n,k = map(int,input().split())
a = []
cnt = 0

for i in range(n):
    b = int(input())
    a.append(b)

b = a[0]

for i in range(n):
    if((abs(a[i] - b)) <= k):
        cnt += 1
        b = a[i]

print(cnt)


    
