import std.stdio;
import std.algorithm;
import std.conv;
import std.numeric;
import std.math;
import std.string;

void main()
{
	auto n = to!int(chomp(readln()));
	int[] v;
	foreach (token; split(chomp(readln())))
	{
		v ~= to!int(token);
	}
	int[int] cnt0, cnt1;
	foreach (i, e; v)
	{
		if (i % 2 == 0)
		{
			++cnt0[e];
		}
		else
		{
			++cnt1[e];
		}
	}
	int sum0, sum1;
	int[2][] arr0, arr1;
	foreach (key; cnt0.keys)
	{
		arr0 ~= [key, cnt0[key]];
	}
	arr0.sort!"a[1] > b[1]"();
	foreach (key; cnt1.keys)
	{
		arr1 ~= [key, cnt1[key]];
	}
	arr1.sort!"a[1] > b[1]"();

	int i, j;
	while (arr0[i][0] == arr1[j][0])
	{
		int d0 = arr0[i][1] - arr0[i+1][1];
		int d1 = arr1[j][1] - arr0[j+1][1];
		if (d0 < d1 && i < arr0.length - 1) ++i;
		else if (j < arr1.length - 1) ++j;
		else
		{
			i = j = -1;
			break;
		}
	}
	int result;
	if (i == -1) result = arr1[0][1];
	else
	{
		foreach (ai, e; arr0)
		{
			if (ai == i) continue;
			result += e[1];
		}
		foreach (ai, e; arr1)
		{
			if (ai == j) continue;
			result += e[1];
		}
	}

	writeln(result);
	stdout.flush();
}