fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val v = readLine()!!.split(' ').map(String::toInt)
    val odd = IntArray(100001)
    val eve = IntArray(100001)
    for (i in 0 until n) {
        if (i % 2 == 0) eve[v[i]]++
        else odd[v[i]]++
    }
    var mO = odd.max()!!
    var mE = eve.max()!!
    val dic = mutableSetOf<Int>()
    for (i in 1..100000) {
        if (odd[i] == mO) {
            dic.add(i)
            odd[i] = 0
        }
        if (eve[i] == mE) {
            dic.add(i)
            eve[i] = 0
        }
    }
    if (dic.size > 1) {
        println(n - mO - mE)
        return
    }
    var mO2 = odd.max()!!
    var mE2 = eve.max()!!
    var xx = Math.max(mO+mE2, mE+mO2)
    println(n - xx)
}