
n, k = (int(x) for x in input().split())

a_list = []
for i in range(n):
    a_list.append(int(input()))

# print(a_list)

ans = 1
b = a_list[0]

for i in range(1, n):
    
    if abs(a_list[i] - b) <= k :
        ans += 1
        b = a_list[i]

print(ans)