object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val a = Array.fill(n)(sc.nextInt())
  val d = a.distinct.length
  val ans = if ((a.length - d) % 2 == 0) d else d-1
  println(ans)
}
