fun c111(args: Array<String>) {
    val numList = args[1].split(" ").map { it.toInt() }
    val firstList = numList.filterIndexed { index, num -> index % 2 == 0 }
    val secondList = numList.filterIndexed { index, num -> index % 2 == 1 }

    var firstMap = mutableMapOf(0 to 0)
    firstList.forEach {
        if (!firstMap.containsKey(it)) {
            firstMap.put(it, 0)
        }
        firstMap.put(it, firstMap[it]!! + 1)
    }

    var secondMap = mutableMapOf(0 to 0)
    secondList.forEach {
        if (!secondMap.containsKey(it)) {
            secondMap.put(it, 0)
        }
        secondMap.put(it, secondMap[it]!! + 1)
    }

    val sortedFirstMap = firstMap.entries.sortedByDescending { it -> it.value }
    val sortedSecondMap = secondMap.entries.sortedByDescending { it -> it.value }

    if (sortedFirstMap[0].key != sortedSecondMap[0].key) {
        println((firstList.size - sortedFirstMap[0].value) + (secondList.size - sortedSecondMap[0].value))
    } else {
        val res = Math.min(
                ((firstList.size - sortedFirstMap[1].value) + (secondList.size - sortedSecondMap[0].value)),
                ((firstList.size - sortedFirstMap[0].value) + (secondList.size - sortedSecondMap[1].value))
        )
        println(res)
    }

}

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

fun readLineList(): Array<String> {
    val lineList = mutableListOf<String>()
    while (true) {
        val line = readLine()
        if (line.isNullOrBlank()) {
            break
        } else {
            lineList.add(line!!)
        }
    }
    return lineList.toTypedArray()
}