object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    // 偶数番目, 奇数番目の数が, それぞれ全て同じであればいい
    // かつ, どちらも異なる数

    val N = sc.nextInt()
    val Vm = 100000
    val OddN, EvenN = new Array[Int](Vm+1)

    (0 until N) foreach { i =>
      val v = sc.nextInt()
      if (i % 2 == 0) {
        EvenN(v) += 1
      } else  {
        OddN(v) += 1
      }
    }

    def find(s: Int, arr: IndexedSeq[Int], arr2: Array[Int]): (Int, Int) = {
      var i = s
      val sp = arr2(arr(s))
      while (i <= Vm && arr2(arr(i)) == sp) {
        i += 1
      }
      (i, arr2(arr(i)))
    }

    def solve(): Int = {
      val Odd = (0 to Vm).sortBy(i => OddN(i))(Ordering.Int.reverse)
      val Even = (0 to Vm).sortBy(i => EvenN(i))(Ordering.Int.reverse)

      var i = 0
      var j = 0
      while (i < Vm && j < Vm) {
        val oN = OddN(Odd(i))
        val eN = EvenN(Even(j))

        if (Odd(i) == 0)
          return N - eN
        else if (Even(j) == 0)
          return N - oN

        if (Odd(i) != Even(j)) {
          return N - oN - eN
        }

        val (oni, onv) = find(i, Odd, OddN)
        val (enj, env) = find(j, Even, EvenN)
        if (onv > env)
          i = oni
        else
          j = enj
      }
      N
    }
    println(solve())
  }

}
