import java.util.Scanner

object Main {
    case class pseudoMap(key:Int , count:Int)
    implicit def tupleToName(tup: (Int, Int)): pseudoMap = tup match {
        case (key, count) => pseudoMap(key, count)
    }

    def main(args: Array[String]): Unit = {
        val scanner = new Scanner(System.in)
        val n: Int = scanner.nextInt
        val vs: List[Int] = List.fill(n)(scanner.nextInt)
        println(calc(vs))
    }

    def calc(nums: List[Int] ): Int ={
        val (evens, odds) = nums.zipWithIndex.partition(_._2 % 2 == 0)
        val (evensFirst, evensSecond) = take2MostOrder(evens.map(_._1))
        val (oddsFirst, oddsSecond) = take2MostOrder(odds.map(_._1))

        if (evensSecond.key == -1 && oddsSecond.key == -1){
          if (evensFirst.key != oddsFirst.key)
              0
          else
              nums.length / 2
        }
        else {
          if (evensFirst.key != oddsFirst.key)
              nums.length - evensFirst.count - oddsFirst.count
          else
            (nums.length - evensFirst.count - oddsSecond.count) min (nums.length - evensSecond.count - oddsFirst.count)
        }
    }

    def take2MostOrder(nums: List[Int]): ((Int,Int),(Int,Int)) = {
      val sortedNums: Seq[(Int, Int)] = nums.groupBy(n => n).mapValues(_.length).toSeq.sortBy(_.count).reverse
      (sortedNums(0), try{sortedNums(1)}catch{case e :Exception => (-1, Int.MinValue)})
    }
}
