fun ac103(args: Array<String>) {
    val numList = args[1].split(" ").map { it.toInt() }
    val evenNumToCount = mutableMapOf(0 to 0)
    val oddNumToCount = mutableMapOf(0 to 0)
    numList.forEachIndexed { index, num ->
        if (index % 2 == 0) {
            if (!evenNumToCount.containsKey(num)) {
                evenNumToCount[num] = 0
            }
            evenNumToCount[num] = evenNumToCount[num]!! + 1
        } else {
            if (!oddNumToCount.containsKey(num)) {
                oddNumToCount[num] = 0
            }
            oddNumToCount[num] = oddNumToCount[num]!! + 1
        }
    }

    val evenSorted = evenNumToCount.entries.sortedByDescending { it.value }
    val oddSorted = oddNumToCount.entries.sortedByDescending { it.value }
    if (evenSorted[0].key != oddSorted[0].key) {
        println(numList.size - evenSorted[0].value - oddSorted[0].value)
    } else {
        println(Math.min(numList.size - evenSorted[0].value - oddSorted[1].value,
                numList.size - evenSorted[1].value - oddSorted[0].value))

    }
}

fun main(args: Array<String>) {
    ac103(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()
}