#include<bits/stdc++.h>
#define N 100005
using namespace std;
int n,a[N],mx1=0,mx2=0,mx3=0,mx4=0,num1=0,num2=0,num3=0,num4=0;
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	for (int i=1;i<=n;i+=2)
	{
		if (a[i]>mx1)
		{
			mx2=mx1;
			mx1=a[i];
			num1=1;
		}
		else if (a[i]==mx1)
		{
			num1++;
		}
		else if (a[i]>mx2)
		{
			mx2=a[i];
			num2=1;
		}
		else if (a[i]==mx2)
		{
			num2++;
		}
	}
	for (int i=2;i<=n;i+=2)
	{
		if (a[i]>mx3)
		{
			mx4=mx3;
			mx3=a[i];
			num3=1;
		}
		else if (a[i]==mx3)
		{
			num3++;
		}
		else if (a[i]>mx4)
		{
			mx4=a[i];
			num4=1;
		}
		else if (a[i]==mx4)
		{
			num4++;
		}
	}
	// cout<<mx1<<" "<<mx2<<" "<<mx3<<" "<<mx4<<endl;
	// cout<<num1<<" "<<num2<<" "<<num3<<" "<<num4<<endl;
	if (mx1!=mx3) printf("%d",n-num1-num3);
	else printf("%d",min(n-num1-num4,n-num2-num3));
	return 0;
}