object Main extends App {
  import scala.io.StdIn.{readInt, readLine}
  val _ = readInt()
  val numbers = readLine().split(' ').map(_.toInt)

  val Array(first, second) = numbers.take(2)

  def findMaxAppearNumber(values: Seq[Int]): Int = {
    values.groupMapReduce(identity)(_ => 1)(_ + _).max._1
  }

  def computeChangeCount(values: Seq[Int]): Int = {
    val maxAppearedNumber = findMaxAppearNumber(values)
    values.count(_ != maxAppearedNumber)
  }

  val suggestedChangeSize = if (first == second) {
    0
  } else {
    val (odds, evens) = numbers.zipWithIndex.partition(_._2 % 2 == 0)
    computeChangeCount(odds.map(_._1)) + computeChangeCount(evens.map(_._1))
  }

  println(suggestedChangeSize)
}