n, k = map(int, input().split())
a = [int(input()) for _ in range(n)]

l = [a[0]]
cnt = 1
for i in range(1, n):
    for j in range(len(l)):
        if abs(l[j] - a[i]) <= k:
            cnt += 1
            l = [a[i]]
            break


print(cnt)
    