n = gets.to_i level = gets.chomp.split(" ").map(&:to_i) hash_level = Hash.new(0) level.each{|value| hash_level[value] += 1 } puts hash_level.invert[hash_level.values.max]