#include <bits/stdc++.h>

#define NREP() for(ll i = 0; i < n; i++)
#define MREP() for(ll j = 0; j < m; j++)
#define REP(i, x, y) for(ll i = x; i < y; i++)
#define ALL(x) (x).begin(), (x).end()
#define MSG(x) cout << x << endl;
#define MSGF(x, n) MSG(fixed << setprecision(n) << x)
#define END(x) cout << x << endl; return(0);
#define IPT(v, n) REP(i, 0, n){ cin >> v[i]; }
#define YN(x) x ? cout << "YES" << endl : cout << "NO" << endl;
#define Yn(x) x ? cout << "Yes" << endl : cout << "No" << endl;
#define yn(x) x ? cout << "yes" << endl : cout << "no" << endl;

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<double> vd;
typedef vector<vector<double>> vvd;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;

const static ll MOD = 1e9 + 7;
const static ll INF = 1LL << 30;

ll a, b, c, d, k, l, m, n, h, w, q, x, y;
string s, t;

ll ans = 0;
ll sum = 0;
ll cnt = 0;
ll cur = 0;
ll tmp = 0;
ll mini = INF;
ll maxi = 0;

double ave = 0.0;

ll mod_pow(ll base, ll power) {
    if (power == 0) return 1;
    if (power == 1) return base % MOD;
    if (power % 2 == 0) return ((mod_pow(base % MOD, (power / 2)) % MOD) * (mod_pow(base, (power / 2)) % MOD)) % MOD;
    return (base % MOD * (mod_pow(base % MOD, power - 1) % MOD)) % MOD;
}

ll mod_fact(ll number) {
    ll ret = 1;
    ll count = 1;
    while (count <= number) {
        ret *= (count % MOD);
        ret %= MOD;
        count++;
    }
    return ret % MOD;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main() {
    cin >> n;
    vl v(n + 10, 0);
    map<ll, ll> odd, evn;
    ll odd_max = -1;
    ll odd_max_cnt = -1;
    ll odd_snd = -1;
    ll odd_snd_cnt = -1;
    ll evn_max = -1;
    ll evn_max_cnt = -1;
    ll evn_snd = -1;
    ll evn_snd_cnt = -1;

    NREP() {
        cin >> v[i];
        if (i % 2 == 0) {
            odd[v[i]]++;
            if (odd[v[i]] > odd_max_cnt) {
                odd_max = v[i];
                odd_max_cnt = odd[v[i]];
            } else if (odd[v[i]] > odd_snd_cnt) {
                odd_snd = v[i];
                odd_snd_cnt = odd[v[i]];
            }
        } else {
            evn[v[i]]++;
            if (evn[v[i]] > evn_max_cnt) {
                evn_max = v[i];
                evn_max_cnt = evn[v[i]];
            } else if (evn[v[i]] > evn_snd_cnt) {
                evn_snd = v[i];
                evn_snd_cnt = evn[v[i]];
            }
        }
    }

    if (odd_max != evn_max) {
        NREP() {
            if (i % 2 == 0) {
                if (v[i] != odd_max) ans++;
            } else {
                if (v[i] != evn_max) ans++;
            }
        }
        END(ans)
    } else {
        ans = LLONG_MAX;
        // odd: max, evn: snd
        NREP() {
            if (i % 2 == 0) {
                if (v[i] != odd_max) cnt++;
            } else {
                if (v[i] != evn_snd) cnt++;
            }
        }
        ans = min(cnt, ans);
        // odd: snd, evn: max
        cnt = 0;
        NREP() {
            if (i % 2 == 0) {
                if (v[i] != odd_snd) cnt++;
            } else {
                if (v[i] != evn_max) cnt++;
            }
        }
        ans = min(cnt, ans);
        END(ans)
    }
}


Measured memory_bytes: 7296