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

    val mapForOdd = mutableMapOf<Int, Int>()
    val mapForEven = mutableMapOf<Int, Int>()
    // O(n)
    V.forEachIndexed { index, v ->
        // even
        if (index % 2 == 0) {
            if (!mapForEven.containsKey(v)) {
                mapForEven[v] = 0
            }
            mapForEven[v] = mapForEven[v]!! + 1
        }

        // odd
        if (index % 2 == 1) {
            if (!mapForOdd.containsKey(v)) {
                mapForOdd[v] = 0
            }
            mapForOdd[v] = mapForOdd[v]!! + 1
        }
    }

    // O(n)
    val oddMax = mapForOdd.maxBy { it.value  }!!
    val evenMax = mapForEven.maxBy { it.value  }!!

    var oddRep : Int?
    var evenRep : Int?

    if (oddMax.key == evenMax.key) {
        val even = mapForEven.entries.sortedBy { it.value * - 1 }
        val odd = mapForOdd.entries.sortedBy { it.value * - 1 }

        if (even.map { it.value }.joinToString("") >= odd.map { it.value }.joinToString("")) {
            evenRep = if (even.size == 1) null else even[1].key
            oddRep = oddMax.key
        } else {
            evenRep = evenMax.key
            oddRep = if (odd.size == 1) null else odd[1].key
        }
    } else {
        oddRep = oddMax.key
        evenRep = evenMax.key
    }

    mapForOdd.remove(oddRep)
    mapForEven.remove(evenRep)

    // O(n)
    val ans = mapForOdd.values.sum() + mapForEven.values.sum()
    println(ans)
}
