fun main(arr:Array<String>) {
    val itemCount = readLine()!!.toInt()
    val numbers = readLine()!!.split(" ").map { it.toInt() }
    val odd = mutableMapOf<Int,Int>()
    val even = mutableMapOf<Int,Int>()
    numbers.indices.forEach {
        if(it%2==0) {
            even[numbers[it]] = (even[numbers[it]]?:0) + 1
        } else {
            odd[numbers[it]] = (odd[numbers[it]]?:0) + 1
        }
    }
    var ans = itemCount
    val oddList = odd.toList().sortedByDescending { it.second }
    val evenList = even.toList().sortedByDescending { it.second }
    if(oddList.first().first == evenList.first().first) {
        ans = itemCount - oddList.first().second - if(evenList.size <= 1) 0 else evenList[1].second
        ans = Math.min(ans,itemCount - evenList.first().second - if(oddList.size <= 1) 0 else oddList[1].second)
    } else {
        ans = itemCount - oddList.first().second - evenList.first().second
    }
    println(ans)
}