fun main(args: Array<String>) {
    abc111c()
}

fun abc111c() {
    val n = readLine()!!.toInt()
    val vList = readLine()!!.split(" ").map { it.toInt() }

    val halved = n / 2

    if (vList.all { it == vList[0] }) return println(halved)

    val evensFreq = vList.filterIndexed { index, i -> index % 2 == 0 }.groupBy { it }
        .map { it.value }.sortedByDescending { it.size }

    val oddsFreq = vList.filterIndexed { index, i -> index % 2 != 0 }.groupBy { it }
        .map { it.value }.sortedByDescending { it.size }

    val answer = if (evensFreq.first().first() != oddsFreq.first().first()) {
        n - evensFreq.first().size - oddsFreq.first().size
    } else {
        // 配列外参照起こさせるエッジケースはなさそうなのでこれでいいや
        if (evensFreq[1].size > oddsFreq[1].size) {
            n - evensFreq[1].size - oddsFreq.first().size
        } else {
            n - evensFreq.first().size - oddsFreq[1].size
        }
    }
    println(answer)
}
