N, K = map(int, input().split())
A_list = [int(input()) for i in range(N)]
count_num = 1
first = 0
for i in range(N):
  for j in range(first+1, N):
    if abs(A_list[first]-A_list[j])<=K:
      count_num+=1
      first=j
      break
print(count_num)
