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

alias sread = () => readln.chomp();
alias Point2 = Tuple!(long, "y", long, "x");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

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;
    }
}

void minAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) min(dst, src);
}

void maxAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) max(dst, src);
}

enum MOD = (10 ^^ 9) + 7;

void main()
{
    long N = lread();
    auto V = aryread();
    long[long][2] D;
    foreach (i; 0 .. N)
    {
        D[i & 1][V[i]] = (V[i] in D[i & 1]) ? D[i & 1][V[i]] + 1 : 1;
    }
    long[][2] k;
    long[][2] v;
    k[0] = D[0].keys;
    v[0] = D[0].values;
    zip(v[0], k[0]).sort();
    k[1] = D[1].keys;
    v[1] = D[1].values;
    zip(v[0], k[0]).sort!"b<a"();
    zip(v[1], k[1]).sort!"b<a"();
    // writeln(k);
    if (k[0][0] != k[1][0])
    {
        writeln(N - v[0][0] - v[1][0]);
        return;
    }
    if (v[0][0] + v[1][0] == N)
    {
        writeln(N / 2);
        return;
    }
    long ans = long.max;
    if (k[0][1] != k[1][0])
    {
        ans = ans.min(N - v[0][1] - v[1][0]);
    }
    if (k[0][0] != k[1][1])
    {
        ans = ans.min(N - v[0][0] - v[1][1]);
    }
    writeln(ans);
}
