p STDIN.read.split.drop(1).group_by(&:to_i).values.map(&:size).map {|n| n / 2 * 4 + n % 2 }.inject(:+) / 4