#include<bits/stdc++.h>

#define ll long long
#define endl '\n'
#define disp(x) cout << (x) << endl
#define pb push_back
#define ff first
#define ss second
#define NOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define REPI(n) for(int i = 0;i<(n);i++)
#define REPJ(n) for(int j = 0;j<(n);j++)





using namespace std;

/*
//Number Theory-------------


ll int gcd(ll int x,ll int y){
    while(x!=0 && y!=0){
        ll int tmp = x;
        x = y;
        y = tmp%y;
    }
    return x+y;
}
// alter :: use __gcd(A,B)

ll int modExp(ll int x,ll int n,ll int M){

    ll int result=1;
    while(n>0){
        if(n % 2 ==1)
            result=(result * x)%M;
        x=(x*x)%M;
        n=n/2;
    }
    return result;
}

ll int e, x, y;
void extendedEuclid(ll int A, ll int B) {
    if(B == 0) {
        //d = A;
        x = e/A;
        y = 0;
    }
    else {
        extendedEuclid(B, A%B);
        ll int temp = x;
        x = y;
        y = temp - (A/B)*y;
    }
}

ll int modInverse(ll int A, ll int M){

    extendedEuclid(A,M);
    return (x%M+M)%M;    //x may be negative
}



bool checkPrime(int n){
    if(n==1)return 0;
    for(int i = 2;i*i<=n;i++){
        if(n%i==0)return 0;
    }
    return 1;
}

void sieve(bool isPrime[],int n){
    REPI(n+1){
        isPrime[i] = 1;
    }
    isPrime[1] = isPrime[0] = 0;

    for(int i = 2;i*i<=n;i++){
        if(isPrime[i]){
            for(int j = i*i;j<=n;j+=i)isPrime[j] = 0;
        }
    }
}

vector<int> factorize(int n){
    vector<int>res;
    for(int i = 2;i*i<=n;i++){
        while(n%i==0){
            res.pb(i);
            n = n/i;
        }
    }
    if(n!=1)res.pb(n);
    return res;
}

vector<int> fast_factorize(int n){
    int minPrime[n + 1]={0};
    for (int i = 2; i * i <= n; ++i) {
        if (minPrime[i] == 0) {
            for (int j = i * i; j <= n; j += i) {
                if (minPrime[j] == 0) {
                    minPrime[j] = i;
                }
            }
        }
    }
    for (int i = 2; i <= n; ++i) {
        if (minPrime[i] == 0) {
            minPrime[i] = i;
        }
    }
    vector<int> res;
    while (n != 1) {
        res.pb(minPrime[n]);
        n /= minPrime[n];
    }
    return res;
}
*/
/*

// right most once
x^(x&(x-1)) , x&(-x)

// set nth bit 1
x|1<<n
// unset nth bit
x&(!(1<<n))
//check nth bit
x&(1<<n)

//power of 2
n && !(n&(n-1)

// left shift x<<y
// right shift x>>y

*/
/*
//Graphs--------------------
vector<bool>vis;
vector<vector<int> >adj;

void dfs(int s){
    vis[s] = 1;
    REPI(adj[s].size()){
        if(!vis[adj[s][i]])dfs(adj[s][i]);
    }
}
*/


int main(){
    NOS;
    int n;
    cin >> n;
    int a[n/2],b[n/2];
    REPI(n){
        if(i%2==0)cin >> a[i/2];
        else cin >> b[i/2];
    }
    sort(a,a+n/2);
    sort(b,b+n/2);
    int cnt=1;
    vector<pair<int,int> >v1,v2;

    for(int i=1;i<n/2;i++){
        if(a[i]==a[i-1])cnt++;
        else{
            v1.pb({a[i-1],(n/2)-cnt});
            cnt = 1;
        }
    }
    v1.pb({a[n/2-1],n/2-cnt});
    cnt=1;
    for(int i=1;i<n/2;i++){
        if(b[i]==b[i-1])cnt++;
        else{
            v2.pb({(n/2)-cnt,b[i-1]});
            cnt = 1;
        }
    }
    v2.pb({n/2-cnt,b[n/2-1]});
    sort(v2.begin(),v2.end());

    int ans = n;
    int i=0,j=0;
    for(i=0;i<v1.size();i++){
        j = 0;
        while(j<v2.size() && v2[j].ss==v1[i].ff)j++;
        if(j==v2.size()){
            ans = min(ans,n/2);
        }
        else{
            ans = min(ans,v1[i].ss + v2[j].ff);

        }
    }
    disp(ans);
    return 0;

}



















//priority_queue<int,vector<int>,greater<int> > mypq;
// vector<int>::iterator it,ls;
// ls = set_difference(a,a + n, b, b + n-1, v.begin());
// for (it = v.begin(); it < ls; ++it)
//         disp(*it);

//next_permutation(a,a+n)
//cout<< fixed << setprecision(2)<< variable << endl;


Measured memory_bytes: 1784