n,k = gets.split(" ").map(&:to_i)
array_b = []

array_b[0] = gets.chomp.to_i

j = 0

(1...n).each do |i|
  temp = gets.to_i
  if (array_b[j]-temp).abs <= k
    array_b[j+1] = temp
    j = j+1
  end
end

puts array_b.size