/**
 *
 *  Pritish Thakkar
 *
 *		- "Red" is waiting !!
 **/

#include<bits/stdc++.h>
#include<cstdio>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define clr(a) memset(a, 0, sizeof(a))1
#define sz(x) x.size()
#define rep(n) for(int i = 0 ; i < n ;i ++)
#define repc(i, n) for(int i = 0 ; i < n ; i ++)
#define FOR(i, x, y) for(int i = x ; i < y ; i ++)
#define DEC(i, x, y) for(int i = x ; i >= y ; i --)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b,c))
#define max3(a, b, c) max(a, max(b, c))
#define alla(a, n) a, a+n

using namespace std;

// Some typedef's
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
 
// UTILITY FUNCTIONS

// String
char toUpper(const char &c) {return isupper(c)?c:c-'a'+'A';}
char toLower(const char &c) {return islower(c)?c:c+'a'-'A';}
bool isvowel(char c) {c = toLower(c); return (c == 'a' or c == 'e' or c == 'i' or c == 'i' or c == 'o' or c == 'u' || c == 'y');}
void toLowerCase(string &s){rep(s.size()){if(!islower(s[i])){s[i] = tolower(s[i]);}}}
void toUpperCase(string &s){rep(s.size()){s[i] = toupper(s[i]);}}
bool ispal(string s){ll lo, hi;lo = 0;hi = s.length()-1;while(lo <= hi){if(s[lo] != s[hi]){return 0;}lo++;--hi;}return 1;}
template<class T >string toString(T n){string v = "";while(n){v.pb(n % 10 + '0');n /= 10;}reverse(all(v));return v;}

// Maths
template<typename t> t gcd(t a, t b){a = abs(a), b = abs(b);return ((b == 0) ? a : gcd(b, a%b));}
template<typename t> t lcm(t a, t b){return (a * (b / gcd(a, b)));}
template <typename T> T modpow(T base, T exp, T modulus) {base %= modulus;T result = 1;while (exp > 0) {if (exp & 1) result = (result * base) % modulus;base = (base * base) % modulus;exp >>= 1;}return result;}
template<typename T> void cumulative(T *a, T *b, T n){rep(n){i ? b[i] = b[i-1] + a[i] : b[i] = a[i];}}

// Some constants
const int inf = 1e9 + 7;
const int eps = 1e-9;

//------------------------------------------------------------------------

void solve(){
	ll n;
	cin >> n;
	ll a[n];
	rep(n){
		cin >> a[i];
	}
	vi x, y;
	rep(n){
		if(i & 1)
			x.pb(a[i]);
		else
			y.pb(a[i]);
	}

	vii X, Y;
	map<ll, ll > foo, bar;
	for(int i = 0 ; i < sz(x) ; i ++){
		foo[x[i]]++;
	}
	for(int i = 0 ; i < sz(y) ; i ++){
		bar[y[i]]++;
	}

	for(auto m : foo){
		X.pb({m.sc, m.fr});
	}

	for(auto m : bar){
		Y.pb({m.sc, m.fr});
	}

	sort(all(X), greater<ii>() );
	sort(all(Y), greater<ii>() );

	ll replacementA, replacementB;
	replacementA = replacementB = 0;
	
	if(X[replacementA].sc == Y[replacementB].sc){
		if(sz(X) > sz(Y) && sz(Y) > 1){
			replacementB++;
		}else if(sz(X) > 1){
			replacementA++;
		}else{
			replacementB = -1;
		}
	}

	if(replacementB == -1){
		cout << n / 2 << endl;
	}
	else{
		ll ans = 0;
		for(int i = 0 ; i < n ; i ++){
			if(i & 1){
				if(a[i] != X[replacementA].sc)ans++;
			}else{
				if(a[i] != Y[replacementB].sc)ans++;
			}
		}
		cout << ans << endl;
	}
}

int main(){
    std::ios::sync_with_stdio(0);
    cin.tie(0);
    #ifdef ONLINE_JUDGE
    #else
      //  freopen("input.txt" , "r" , stdin);
       	// freopen("output.txt", "w", stdout);
    #endif
        ll t=1;
        // cin >> t;
        while(t--)
 	 		solve();
}

Measured memory_bytes: 10352