#include<bits/stdc++.h>
using namespace std;

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

int main(){
    int n;
    cin >> n;

    map<int, int> p;
    map<int, int> q;
    int even = n / 2;
    int v[even];
    int o[even];
    for(int i = 0; i < n; i++){
        if(i % 2 == 0){
            cin >> v[i / 2];
            p[v[i / 2]]++;
        }else{
            cin >> o[i / 2];
            q[o[i / 2]]++;
        }
    }

    int maxv = 0;
    int maxv_ele = 0;
    int maxv_2 = -1;
    int maxv_2_ele = -1;
    for(auto itr = p.begin(); itr != p.end(); ++ itr){
        if(itr == p.begin()){
            maxv =  itr -> first;
            maxv_ele = itr -> second;
        }else{
            int k = itr -> first;
            int s = itr -> second;
            if(maxv_ele < s){
                maxv_ele = s;
                maxv = k;
            }
        }
    }
    int flag = 0;
    if(maxv_ele != even){
        for(auto itr = p.begin(); itr != p.end(); ++ itr){
            if(flag == 0){
                int k = itr -> first;
                int s = itr -> second;
                if(k != maxv){
                    maxv_2 =  itr -> first;
                    maxv_2_ele = itr -> second;
                    flag = 1;
                }
            }else{
                int k = itr -> first;
                int s = itr -> second;
                if(maxv_2_ele < s){
                    if(k != maxv){
                        maxv_2_ele = s;
                        maxv_2 = k;
                    }
                }
            }
        }
    }

    int maxo = 0;
    int maxo_ele = 0;
    int maxo_2 = -1;
    int maxo_2_ele = -1;
    for(auto itr = q.begin(); itr != q.end(); ++ itr){
        if(itr == q.begin()){
            maxo =  itr -> first;
            maxo_ele = itr -> second;
        }else{
            int k = itr -> first;
            int s = itr -> second;
            if(maxo_ele < s){
                maxo_ele = s;
                maxo = k;
            }
        }
    }
    flag = 0;
    if(maxo_ele != even){
        for(auto itr = q.begin(); itr != q.end(); ++ itr){
            if(flag == 0){
                int k = itr -> first;
                int s = itr -> second;
                if(k != maxo){
                    maxo_2 =  itr -> first;
                    maxo_2_ele = itr -> second;
                    flag = 1;
                }
            }else{
                int k = itr -> first;
                int s = itr -> second;
                if(maxo_2_ele < s){
                    if(k != maxo){
                        maxo_2_ele = s;
                        maxo_2 = k;
                    }
                }
            }
        }
    }
    int cou = 0;
    int cou1 = 0;
    int ans = 0;
    if(maxv != maxo){
        ans += (even - maxv_ele);
        ans += (even - maxo_ele);
    }else{
        if(maxv_2 == -1 && maxo_2 == -1){
            ans = even;
        }else if(maxv_2 == -1){
            ans += (even - maxo_ele);
        }else if(maxo_2 == -1){
            ans += (even - maxv_ele);
        }else{
            cou += (even - maxv_ele);
            cou += (even - maxo_2_ele);
            cou1 += (even - maxv_2_ele);
            cou1 += (even - maxo_ele);
            if(cou < cou1){
                ans = cou;
            }else{
                ans = cou1;
            }
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 5376