n = gets.to_s.to_i a = Array.new(n) { gets.to_s.to_i }.sort case n when 1 puts 1 exit else a.each_cons(2) do |i, j| if j - i == 1 puts 2 exit end end end puts 1