// C - /\/\/\/
#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
#define allr(x) (x).rbegin(),(x).rend()
#define fst first
#define snd second

int main(){
	int N; cin>>N;
	vector<pair<int,int>> E(100000),O(100000);//[value]<count,value>
	rp(i, 0, N/2){
		int e,o; scanf("%d%d",&e,&o); e--;o--;
		E[e].fst++; E[e].snd = e+1;
		O[o].fst++; O[o].snd = o+1;
	}
	sort(allr(E)); sort(allr(O));
	int ans = N;
	ans -= E[0].snd != O[0].snd? E[0].fst + O[0].fst:
		max(E[0].fst + O[1].fst, E[1].fst + O[0].fst);
	cout<< ans <<endl;
}