object Main {
  
  import scala.io.StdIn

  def main(args: Array[String]): Unit = {
    val n = StdIn.readInt
    val as = StdIn.readLine.split(" ").map(_.toInt)
    val cs = Array.fill(Math.pow(5.0, 10.0).toInt + 1)(0)
    as.foreach(i => cs(i) += 1)
    var one = 0
    var two = 0
    cs.foreach(c => if (c != 0) { if (c%2 == 1) one += 1 else two += 1 })
    one += two / 2 * 2
    println(one)
  }
}