N, K = map(int, input().split())
A = [int(input()) for n in range(N)]

B = []
for idx, a in enumerate(A):
  if idx == 0:
    tmp = a
    B.append(a)
    continue
  if abs(tmp - a) <= K:
    B.append(a)
    tmp = a

print(len(B))
