object Main {

  import scala.io.StdIn

  def main(args: Array[String]): Unit = {
    StdIn.readLine
    println {
      StdIn
        .readLine
        .split(" ")
        .map(_.toInt)
        .groupBy(identity)
        .map { case (_, ns) => ns.length % 2 }
        .groupBy(identity)
        .map {
          case (0, ns) => ns.toList.length / 2 * 2
          case (1, ns) => ns.toList.length
        }
        .sum
    }
  }
}