#include<bits/stdc++.h>
#define rep(X,A,B) for(int X=A;X<=B;X++)
#define tep(X,A,B) for(int X=A;X>=B;X--)
#define LL long long
#define DB double
const int N=200010;
const int M=12000010;
const LL MOD=998244353;
using namespace std;

int n,len=0;
int a[N],b[N];
int mx[2],mxx[2],val[2];

void READ(){
	scanf("%d",&n);
	rep(i,1,n)scanf("%d",&a[i]);
}

void SOLVE(int x){
	sort(b+1,b+len+1);
	mx[x]=mxx[x]=0;val[x]=0;
	int num=1;
	b[len+1]=b[len]+1;
	rep(i,2,len+1){
		if(b[i]!=b[i-1]){
			if(num>mx[x])val[x]=b[i-1],mxx[x]=mx[x],mx[x]=num;
			else mxx[x]=max(mxx[x],num);
			num=1;
		}
		else num++;
	}
}

int main(){
	READ();
	len=0;for(int i=1;i<=n;i+=2)b[++len]=a[i];
	SOLVE(0);
	len=0;for(int i=2;i<=n;i+=2)b[++len]=a[i];
	SOLVE(1);
	if(val[0]==val[1])printf("%d\n",n-max(mx[0]+mxx[1],mx[1]+mxx[0]));
	else printf("%d\n",n-mx[0]-mx[1]);
	return 0;
}