unittest
{
	assert( [ "4", "3 1 3 2" ].parse.expand.solve == 1 );
	assert( [ "6", "105 119 105 119 105 119" ].parse.expand.solve == 0 );
	assert( [ "4", "1 1 1 1" ].parse.expand.solve == 2 );
	
	assert( [ "10", "1 1 1 1 1 1 3 2 3 4" ].parse.expand.solve == 5 );		// 追加ケース
}



import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.strip.to!( long );
	input.popFront;
	auto vs = input.front.split.to!( long[] );
	return tuple( vs );
}

auto solve( long[] vs )
{
	auto r = 0L;
	
	// 偶数番目と奇数番目で別々に数をカウント
	long[ long ] es;
	long[ long ] os;
	foreach( i, v; vs )
	{
		if( i % 2 == 0 )
		{
			if( v !in es ) es[ v ] = 1;
			else           es[ v ]++;
		}
		else
		{
			if( v !in os ) os[ v ] = 1;
			else           os[ v ]++;
		} 
	}
	
	// それぞれで一番多い数と二番目に多い数を検索
	auto es_m1k = 0L;
	auto es_m1c = 0L;
	auto es_m2k = 0L;
	auto es_m2c = 0L;
	foreach( k, e; es )
	{
		if( es_m1c < e )
		{
			es_m2k = es_m1k;
			es_m2c = es_m1c;
			es_m1k = k;
			es_m1c = e;
		}
		else if( es_m2c < e )
		{
			es_m2k = k;
			es_m2c = e;
		}
	}
	
	auto os_m1k = 0L;
	auto os_m1c = 0L;
	auto os_m2k = 0L;
	auto os_m2c = 0L;
	foreach( k, e; os )
	{
		if( os_m1c < e )
		{
			os_m2k = os_m1k;
			os_m2c = os_m1c;
			os_m1k = k;
			os_m1c = e;
		}
		else if( os_m2c < e )
		{
			os_m2k = k;
			os_m2c = e;
		}
	}
	
	// 一番多い数が同じだったら二番目に多い数を使う
	if( es_m1k == os_m1k )
	{
		if( es_m1c + os_m2c < es_m2c + os_m1c )
		{
			es_m1k = es_m2k;
			es_m1c = es_m2c;
		}
		else
		{
			os_m1k = os_m2k;
			os_m1c = os_m2c;
		}
	}
	
	// 書き換え対象の数を計算
	r = vs.length - es_m1c - os_m1c;
	
	return r;
}
