local DBG = false
local function dbgpr(...)
    if DBG then
        io.write("[dbg]")
        print(...)
    end
end
---------------------------------
local function main()
    local N = io.read("n")
    local V = {}
    local mt = {__index = function(t,k)return {k, 0};end}
    local evens = setmetatable({}, mt)
    local odds = setmetatable({}, mt)
    for i=1,N do
        local n = io.read("n")
        V[i] = n
        local ref
        if i % 2 == 0 then
            ref = evens
        else
            ref = odds
        end
        local tup = ref[n]
        tup[2] = tup[2] + 1
        ref[n] = tup
    end
    local evens_array = {}
    for k,v in pairs(evens) do
        table.insert(evens_array, v)
    end
    local odds_array = {}
    for k,v in pairs(odds) do
        table.insert(odds_array, v)
    end
    local function sortfunc(x, y)
        return x[2] > y[2]
    end
    table.sort(evens_array, sortfunc)
    table.sort(odds_array, sortfunc)
    if DBG then
        dbgpr("evens")
        for k,v in pairs(evens_array) do
            dbgpr(k,v[1],v[2])
        end
        dbgpr("odds")
        for k,v in pairs(odds_array) do
            dbgpr(k,v[1],v[2])
        end
    end
    local INF = 1000000000
    local function cost(e, o)
        local cost = INF
        if 1 <= e and e <= #evens_array then
            if 1 <= o and o <= #odds_array then
                local e_tup, o_tup = evens_array[e], odds_array[o]
                if e_tup[1] == o_tup[1] then
                    if e_tup[2] > o_tup[2] then
                        cost = (N//2 - e_tup[2]) + N//2
                    else
                        cost = (N//2 - o_tup[2]) + N//2
                    end
                else
                    cost = (N//2 - e_tup[2]) + (N//2 - o_tup[2])
                end
            end
        end
        return cost
    end
    local ans = 0
    local ptn = {{1,1},{1,2},{2,1},{2,2}}
    local cost_min = INF
    for _,v in pairs(ptn) do
        local e, o = v[1], v[2]
        local c = cost(e, o)
        if c < cost_min then
            cost_min = c
        end
    end
    print(cost_min)
end
main()
