N, K = [int(i) for i in input().split()]
A = [0] * N
for i in range(N):
	A[i] = int(input())
ans = 0
i, j = 0, 1
while i < N - 2:
	if abs(A[i] - A[j]) <= K:
		ans += 1
		i = j
	j += 1
if ans > 0:
	ans += 1
print(ans)
