fun main(arr:Array<String>) {
    val n = readLine()!!.toInt()
    val list = readLine()!!.split(" ").map { it.toInt() }
    val odd = mutableMapOf<Int, Int>()
    val even = mutableMapOf<Int, Int>()
    list.indices.forEach {
        val num = list[it]
        var target = odd
        if(it % 2 == 0) {
            target = even
        }
        if(target.containsKey(num)) {
           target[num] = target[num]!! + 1
        } else {
            target[num] = 1
        }
    }
    val oddKeys = odd.keys.sortedByDescending { odd[it] }
    val evenKeys = even.keys.sortedByDescending { even[it] }
    var cnt = 0
    if(oddKeys.first() == evenKeys.first()) {
        if(oddKeys.count() == 1 && evenKeys.count() == 1) {
            cnt = n/2
        } else if(oddKeys.count() == 1) {
            cnt = odd[oddKeys[0]]!! + even[evenKeys[1]]!!
        } else if(evenKeys.count() == 1) {
            cnt = even[evenKeys[0]]!! + odd[oddKeys[1]]!!
        } else {
            cnt = even[evenKeys[0]]!! + odd[oddKeys[1]]!!
            cnt = Math.max(cnt, even[evenKeys[1]]!! + odd[oddKeys[0]]!!)
        }
    } else {
        cnt = even[evenKeys[0]]!! + odd[oddKeys[0]]!!
    }
    val ans = n - cnt;
    println(ans)
}