N=gets.to_i
V=gets.split.map(&:to_i)
odd = V.each_slice(2).map(&:first).group_by(&:itself).map{ |k,v| [k,v.count] }.to_h
even = V.each_slice(2).map(&:last).group_by(&:itself).map{ |k,v| [k,v.count] }.to_h

orank = []
erank = []
odd.sort_by{|_,v|v}.reverse.each { |k,_| orank << k }
even.sort_by{|_,v|v}.reverse.each { |k,_| erank << k }

ans=0
o = orank[0]
e = erank[0]
if orank.size == 1 && erank.size == 1
    ans = o == e ? N/2 : 0
else
    if orank.size == 1
        e = erank[1] if o == e
    elsif erank.size == 1
        o = orank[1] if o == e
    else
        if o == e
            o2 = orank[1]
            e2 = erank[1]
            if odd[o] + even[e2] < odd[o2] + even[e]
                o = o2
            else
                e = e2
            end
        end
    end
    ans = N - odd[o] - even[e]
end

p ans
