from collections import deque
N,K = map(int,input().split())
A = []
for i in range(N):
    A.append(int(input()))
ls = []
l = 0
r = 1
B = deque(A)
if N == 1:
    print(0)
while len(B) > 0:
    e = B.popleft()
    ls.append(e)
    while len(B) > 0:
        q = B.popleft()
        if abs(e-q) <= K:
            B.appendleft(q)
            break
print(len(ls))