#include<bits/stdc++.h> 

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
#define endl "\n"
#define mod 1000000007
#define mod2 998244353
#define double long double
#define pb push_back
#define mk make_pair
#define swap(x,y) (x^=y^=x^=y)
#define TC int ttttt;cin>>ttttt;while(ttttt--)
#define oo 2000000000000000000
#define mem(a,b) memset(a,b,sizeof(a))

//debugging
#define debug1(a) cout<<#a<<" = "<<(a)<<endl;
#define debug2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl;
#define debug3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;
#define debug4(a,b,c,d) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<", "<<#d<<" = "<<(d)<<endl;


using namespace std;

bool isPrime(int n){
    if(n < 2)
        return 0;
    if(n < 4)
        return 1;
    if(n % 2 == 0 or n % 3 == 0)
        return 0;
    for(int i = 5; i*i <= n; i += 6)
        if(n % i == 0 or n % (i+2) == 0)
            return 0;
    return 1;
}

int modexpo(int x,int p){
    int res = 1;
    x = x%mod;
    while(p){
        if(p%2)
            res = res * x;
        p >>= 1;
        x = x*x % mod;
        res %= mod;
    }
    return res;
}

int max(int a,int b){
    return (a>b?a:b);
}

int min(int a,int b){
    return (a<b?a:b);
}

struct node{
    int u,v,w;
    node(int a,int b,int c){
        u = a;
        v = b;
        w = c;
    }
};

struct items{
    int t,d,p,op;
    items(int a,int b,int c,int e){
        t=a;
        d=b;
        p=c;
        op=e;
    }
};

struct compare{
    bool operator() (const items a,const items b) const{
        return a.d < b.d;
    }
    bool operator() (const pair<int,int>a,const pair<int,int>b) const{
        if(a.first == b.first){
            return a.second < b.second;
        }
        return a.first > b.first;
    }
};

int32_t main(){
    IOS  
    int n;
    cin >> n;
    int arr[n];
    map<int,int>mp[2],mpx;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        mp[i%2][arr[i]]++;
        mpx[arr[i]]++;
    }
    set<pair<int,int>,compare>s[2];
    for(auto i : mp[0]){
        s[0].insert({i.second,i.first});
    }
    for(auto i : mp[1]){
        s[1].insert({i.second,i.first});
    }
    // for(auto x: s[0]){
    //     cout<<x.first<<" "<<x.second<<endl;
    // }
    // for(auto x: s[1]){
    //     cout<<x.first<<" "<<x.second<<endl;
    // }
    if(s[0].begin()->second != s[1].begin()->second){
        int a = n/2 - s[0].begin()->first;
        int b = n/2 - s[1].begin()->first;
        cout<<a+b<<endl;
    }
    else{
        if(s[0].size() == 1 && s[1].size() == 1){
            cout<<n/2<<endl;
        }
        else if(s[0].size() == 1 && s[1].size() > 1){
            auto x = s[1].begin();
            x++;
            cout<<n/2 - x->first<<endl;
        }
        else if(s[0].size() > 1 && s[1].size() == 1){
            auto x = s[0].begin();
            x++;
            cout<<n/2 - x->first<<endl;
        }
        else{
            auto x = s[0].begin();
            auto y = s[1].begin();
            x++;y++;
            //cout<<x->first<<" "<<y->first<<endl;
            int a = n - s[0].begin()->first - y->first;
            int b = n - s[1].begin()->first - x->first;
            cout<<min(a,b)<<endl;
        }
    }
}   

Measured memory_bytes: 19840