#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    unordered_map<int, int> mp1, mp2;
    REP(i, n){
        int a;
        cin >> a;
        if(i % 2) mp1[a]++;
        else mp2[a]++;
    }

    // key, value
    int k1, k2, v1 = -1e9, v2 = -1e9;
    bool f1 = false, f2 = false;
    for(auto x : mp1){
        if(v1 >= x.second){
            if(v1 == x.second) f1 = true;
            else{
                f1 = false;
            }
        }
        v1 = max(v1, x.second);
        if(v1 == x.second) k1 = x.first;
    }
    for(auto x : mp2){
        if(v2 >= x.second){
            if(v1 == x.second) f2 = true;
            else{
                f2 = false;
            }
        }
        v2 = max(v2, x.second);
        if(v2 == x.second) k2 = x.first;
    }

    if(k1 != k2 and v1 == v2){
        cout << (n/2 - v1) * 2 << endl;
        return 0;
    }

    if(k1 != k2 and v1 != v2){
        int ans = (n/2 - v1) + (n/2 - v2);
        cout << ans << endl;
        return 0;
    }

    if(k1 == k2 and v1 == v2){
        if(v1 == n/2){
            cout << n/2 << endl;
            return 0;
        }
        if(f1 or f2){
            cout << (n/2 - v1) + (n/2 - v2) << endl;
            return 0;
        }else{
            int kk1, kk2, vv1 = -1e9, vv2 = -1e9;
            for(auto x : mp1){
                if(k1 == x.first) continue;
                vv1 = max(vv1, x.second);
                if(vv1 == x.second) kk1 = x.first;
            }
            for(auto x : mp2){
                if(k2 == x.first) continue;
                vv2 = max(vv2, x.second);
                if(vv2 == x.second) kk2 = x.first;
            }
            if(vv1 >= vv2){
                cout << (n/2 - vv1) + (n/2 - v2) << endl;
                return 0;
            }else{
                cout << (n/2 - v1) + (n/2 - vv2) << endl;
                return 0;
            }
        }
    }

    if(k1 == k2 and v1 != v2){
        int aaa = max(v1, v2);
        if(f1 or f2){
            if(aaa == v1 and f1){
                cout << (n/2 - v1) + (n/2 - v2) << endl;
                return 0;
            }else if(aaa == v2 and f2){
                cout << (n/2 - v1) + (n/2 - v2) << endl;
                return 0;
            }else{
                cout << (n/2 - v1) + (n/2 - v2) << endl;
                return 0;
            }
        }else{
            int kk1, kk2, vv1 = -1e9, vv2 = -1e9;
            for(auto x : mp1){
                if(k1 == x.first) continue;
                vv1 = max(vv1, x.second);
                if(vv1 == x.second) kk1 = x.first;
            }
            for(auto x : mp2){
                if(k2 == x.first) continue;
                vv2 = max(vv2, x.second);
                if(vv2 == x.second) kk2 = x.first;
            }
            int vvvv = max(vv1, vv2);
            if(vvvv = vv1){
                cout << (n/2 - vvvv) + (n/2 - v2) << endl;
                return 0;
            }else{
                cout << (n/2 - v1) + (n/2 - vvvv) << endl;
                return 0;
            }
        }
    }


    return 0;
}

Measured memory_bytes: 4376