N = gets.to_i A = N.times.map { gets.to_i }.sort puts A.each_cons(2).count { |a, b| a + 1 >= b } + 1