#include <iostream>
#include <math.h>
#include <vector>
#include <stack>
#include <cstdio>
#include <string>
#include <bitset>
#include <list>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <functional>
#include <queue>
#include <regex>
#include <cassert>
#include <map>
// #include "bits/stdc++.h"

using namespace std;
//debug

#define rep(i, N, M) for (ll i = N; i < M; ++i)
#define rrep(i, N, M) for (ll i = N; i > M; --i)
#define pb push_back


typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;
typedef priority_queue<ll> pqll;
typedef priority_queue<pll, vector<pll>> pqpll;
typedef priority_queue<ll, vll, greater<ll>> pqll_greater;
typedef priority_queue<pll, vector<pll>, greater<pll>> pqpll_greater;


#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define vec(a) vector<a>
#define _CRT_SECURE_NO_WARNINGS

template<class T, class S>
T atbit(T n, S i) {
	return (n >> i) % i;
}

template<class T>
T getbit(T i) {
	return 1LL << i;
}
template<class T>
T POW(T n, T m) {
	T res = 1;
	rep(i, 0, m) {
		res *= n;
	}
	return res;
}

ll power(ll x, ll y, ll mod) {
	if (y == 0)return 1;
	if (y == 1)return x % mod;
	if (y % 2 == 0)return POW(power(x, y / 2, mod), 2LL) % mod;
	return ((POW(power(x, y / 2, mod), 2LL) % mod)*(x%mod)) % mod;
}
ll div(ll a, ll  b, ll mod) {
	return (a* power(b, mod - 2, mod)) % mod;
}

//#define TRANSFORM(v,w,func) decltype(v) w ; transform((v).begin(),(v).end(),back_inserter(w),func);

using namespace std;

ll MOD_NUM = POW(10LL, 9LL) + 7;

vector<pll >prime_factorize(ll n) {
	vector<pll> res;
	for (ll p = 2; p*p <= n; ++p) {
		if (n%p != 0)continue;
		ll num = 0;
		while (n%p == 0) { ++num; n /= p; }
		res.push_back({ p,num });
	}
	if (n != 1) res.push_back(make_pair(n, 1));
	return res;
}

class Combination {
	// this calculates combination (nCk).
	// Constructor runs in O(MAX).
	// get(n,k) returns nCk in O(1).

	ll MAX, MOD;
	vll fac;
	vll finv;
	vll inv;
public:
	Combination(ll MAX = 210000LL, ll MOD = 1000000007LL)
		:MOD(MOD), MAX(MAX), fac(vll(MAX)), finv(vll(MAX)), inv(vll(MAX)) {
		fac[0] = fac[1] = 1;
		finv[0] = finv[1] = 1;
		inv[1] = 1;
		rep(i, 2, MAX) {
			fac[i] = fac[i - 1] * i % MOD;
			inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
			finv[i] = finv[i - 1] * inv[i] % MOD;
		}
	}

	ll get(ll n, ll k) {
		if (n < k)return 0;
		if (n < 0 || k < 0)return 0;
		return fac[n] * (finv[k] * finv[n - k]%MOD )% MOD;
	}
};

auto count(vll v) {
	vector<pll> res;
	rep(i, 1, POW(10, 5)+1) {
		auto it = lower_bound(all(v), i);
		if (it != v.end()) {
			res.push_back({ i, distance(it, upper_bound(all(v), i)) });
		}
	}
	return res;
}

int main() {
	ll n;
	cin >> n;
	vvll v(2);
	rep(i,0,2)v[i] = vector<ll>(n / 2);
	rep(i, 0, n/2)cin >> v[0][i]>>v[1][i];
	rep(i, 0, 2)sort(all(v[i]));

	vector<vector<pll>> res(2);
	res[0] = count(v[0]);
	res[1] = count(v[1]);

	vll m(2),k(2);
	rep(i, 0, 2) {
		sort(res[i].begin(), res[i].end(), [](pll a, pll b) {
			return a.second < b.second;
		});
		m[i] = res[i].back().second;
		k[i] = res[i].back().first;
	}
	if (k[0] != k[1]) {
		cout << n - m[0] - m[1];
	}
	else if(m[0]<m[1]) {
		cout << n / 2 - m[1] + (n / 2 - res[0][res[0].size() - 2].second);
	}
	else if (m[1] < m[0]) {
		cout << n / 2 - m[0] + (n / 2 - res[1][res[1].size() - 2].second);

	}
	else if(m[0]!=n/2){
		auto m2 = max(res[0][res[0].size() - 2].second, res[1][res[1].size() - 2].second);
		cout << n - m[0] - m2;
	}
	else {
		cout << n / 2;
	}
	

}


Measured memory_bytes: 5996