// #include<bits/stdc++.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <limits.h>
#include <time.h>
#include <map>
#include <set>
#include <vector>
#include <functional>
#include <algorithm>
#include <stack>
#include <list>
#include <queue>
#include <bitset>
// #include <iostream>
// #include <iomanip>
// #include <sstream>
using namespace std;
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define pf printf
#define sf scanf
#define test_ fr(_iii_, 0, 66)cerr<<'>';cerr<<" in\n"
#define deb(x) fr(_iii_, 0, 66)cerr<<'>';cerr<<#x"="<<x<<"\n"
#define deb_array(a, _iiii_, n) fr(_iii_, _iiii_, 66)cerr<<'>'; cerr<<'\n';fr(_iii_,_iiii_,n)cerr<<a[_iii_]<<(_iii_==n-1?"\n":" ");fr(_iii_, _iiii_, 66)cerr<<'>'; cerr<<"\n"
#define deb_matrix(a, h, w) fr(_iii_, 0, 66)cerr<<'>'; cerr<<'\n';fr(_iii_, 0, h){fr(j, 0, w) {cerr << a[_iii_][j] << ' ';}cerr << '\n';}fr(_iii_, 0, 66)cerr<<'>'; cerr<<"\n"
#define fr(i, a, b) for(int i = a ; i < (int)b ; i++)
#define frr(i, a, b) for(int i = a ; i >= (int)b ; i--)
#define tr(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define trr(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define its(x) static_cast< ostringstream & >( ( ostringstream() << dec << x ) ).str()
#define boost ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ln puts("")
#define mems(a) memset(a, 0, sizeof(a))
#define has(cont, x) ((cont).find((x)) != (cont).end())
#define sz(x) ((int)(x).size())
//typedef
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vll;
//bitmask
int on_bit(int x, int pos) {x |= (1 << pos); return x;}
int off_bit(int x, int pos) {x &= ~(1 << pos); return x;}
bool is_on_bit(int x, int pos) {return ((x & (1 << pos)) != 0);}
int flip_bit(int x, int pos) {x ^= (1 << pos); return x;}
int lsb(int x) {return x & (-x);}
int on_bit_all(int x, int pos) {x = (1 << pos)-1; return x;}
//constants
const double EPS = 1e-9;
const double PI = 2*acos(0.0);
const int INF = 0x3f3f3f3f;
const int MOD = 1e9+7;
//moves
const int dx1[] = {0, 1, 0, -1};
const int dy1[] = {1, 0, -1, 0};
const int dx2[] = {-1, -1, -1, 0, 0, 1, 1, 1};
const int dy2[] = {-1, 0, 1, -1, 1, -1, 0, 1};

ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}

const int N = 1e5 + 5;

int a[N];
map<pii,int>freq;
map<int,int>fff,fss;

int main() {
	int n;
	sf("%d",&n);
	fr(i,0,n){
		if(i&1)continue;
		sf("%d%d",a+i,a+i+1);
		fff[a[i]]++;
		fss[a[i+1]]++;
	}
	fr(i,0,n){
		if(i&1)continue;
		freq[pii(a[i],a[i+1])]++;
	}
	if(sz(freq)==1 && freq.begin()->fs.fs == freq.begin()->fs.sc){
		pf("%d\n",n/2);
		return 0;
	}
	int res = 0;
	int cmx = -1,ff,ss;
	tr(it,fff){
		if(it->sc > cmx) {
			ff = it->fs;
			cmx = it->sc;
		}
	}
	cmx = -1;
	tr(it,fss){
		if(it->sc > cmx && it->fs != ff) {
			ss = it->fs;
			cmx = it->sc;
		}
	}

	int wkwk = 0,ff2,ss2;
	cmx = -1;
	tr(it,fss){
		if(it->sc > cmx){
			ss2 = it->fs;
			cmx = it->sc;
		}
	}
	cmx = -1;
	tr(it,fff){
		if(it->sc > cmx && it->fs != ss2) {
			ff2 = it->fs;
			cmx = it->sc;
		}
	}

	fr(i,0,n){
		if(i&1)continue;
		res += (a[i] != ff);
		res += (a[i+1] != ss);
		wkwk += (a[i] != ff2);
		wkwk += (a[i+1] != ss2);
	}
	// pf("%d %d\n",res,wkwk);
	pf("%d\n",min(res,wkwk));
	return 0;
}

Measured memory_bytes: 8448