object Main extends App {
  val n : Int = scala.io.StdIn.readInt
  val v : Seq[Int] = scala.io.StdIn.readLine.split(" ").map(_.toInt)
  val (voi, vei) : (Seq[(Int, Int)], Seq[(Int, Int)]) =
    v.zipWithIndex.partition(_._2 % 2 == 0)
  val Seq(mo, me) : Seq[Map[Int, Int]] =
    Seq(voi, vei).map(_.map(_._1).groupBy(identity).mapValues(_.length))
  val Seq(co, ce) : Seq[Seq[(Int, Int)]] =
    Seq(mo, me).map(_.toSeq.sortBy(- _._2))
  val good = {
    val Seq(go, ge) = Seq(co, ce).map(_.map(_._2))
    if(co.head._1 != ce.head._1) go.head + ge.head
    else Seq(
      go.head + ge.lift(1).getOrElse(0),
      go.lift(1).getOrElse(0) + ge.head
    ).max
  }
  println(n-good)
}
