import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val n = sc.nextInt
  val as = Vector.fill(n)(sc.nextInt).toSet
  val size = as.size

  println(if (size % 2 == 0) size - 1 else size)
}
