import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv, std.math,
    std.functional, std.numeric, std.range, std.stdio, std.string, std.random,
    std.typecons, std.container, std.format;
static import std.ascii;

// dfmt off
T lread(T = long)(){return readln.chomp.to!T();}
T[] lreads(T = long)(long n){return generate(()=>readln.chomp.to!T()).take(n).array();}
T[] aryread(T = long)(){return readln.split.to!(T[])();}
void scan(TList...)(ref TList Args){auto line = readln.split();
foreach (i, T; TList){T val = line[i].to!(T);Args[i] = val;}}
alias sread = () => readln.chomp();enum MOD = 10 ^^ 9 + 7;
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);
// dfmt on

void main()
{
    long N = lread();
    auto V = aryread();
    long v0 = V[0];
    if (V.all!(v => v == v0))
    {
        writeln(N / 2);
        return;
    }
    long[long][2] dict;
    foreach (i; 0 .. N)
    {
        dict[i & 1][V[i]] = dict[i & 1].get(V[i], 0) + 1;
    }
    alias T = Tuple!(long, long);
    auto d0 = dict[0].byKeyValue().map!(t => T(-t.value, t.key)).array;
    d0.sort();
    auto d1 = dict[1].byKeyValue().map!(t => T(-t.value, t.key)).array;
    d1.sort();
    // writeln(d0);
    // writeln(d1);
    if (d0.length == 1 && d1.length == 1)
    {
        writeln(0);
        return;
    }
    long ans = long.max;
    foreach (i; 0 .. 2)
        foreach (j; 0 .. 2)
            if (i < d0.length && j < d1.length)
            {
                if (d0[i][1] != d1[j][1])
                {
                    ans = ans.min(N + d0[i][0] + d1[j][0]);
                }
            }
    writeln(ans);
}
