fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val v = readLine()!!.split(" ").map(String::toInt)

    val oddMap = mutableMapOf<Int, Int>()
    val evenMap = mutableMapOf<Int, Int>()

    v.forEachIndexed { i, e ->
        if (i % 2 == 1) {
            evenMap[e] = evenMap.getOrElse(e, { 0 }) + 1
        } else {
            oddMap[e] = oddMap.getOrElse(e, { 0 }) + 1
        }
    }
    val oddList = oddMap.toList().sortedByDescending { it.second }
    val evenList = evenMap.toList().sortedByDescending { it.second }


    val half = n / 2
    var min = Integer.MAX_VALUE

    val result = if (oddList.first().first != evenList.first().first) {
        oddList.first().second + evenList.first().second
    } else {
        Math.max(
            oddList.first().second + (evenList.getOrNull(1)?.second ?: 0),
            evenList.first().second + (oddList.getOrNull(1)?.second ?: 0)
        )
    }.let { n - it }.let(::println)

}
