//-------------------------------------------------------------//---------------------------------------------------------------
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#include<algorithm>
//---------------------------------------------------------------
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define SIZE 100005
#define INF 1e18
#define all(x) x.begin(),x.end()
#define fi first
#define se second
#define vec vector
using pint = pair<int,int>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
//---------------------------------------------------------------
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const double pi = acos(-1);
const int mod = 1000000007;
struct mint {
    int64_t x;
    mint(int64_t x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {if ((x += a.x) >= mod) x -= mod;return *this;}
    mint& operator-=(const mint a) {if ((x += mod-a.x) >= mod) x -= mod;return *this;}
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(int64_t t) const {if (!t) return 1;mint a = pow(t>>1);a *= a;if (t&1) a *= *this;return a;}
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) {return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
//---------------------------------------------------------------

//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    vll num(100005,0);
    ll n;
    cin>>n;
    vll v1(n/2),v2(n/2);
    ll g=0, m=0;
    rep(i,n){
        if(i%2==1){cin>>v1[g];g++;}
        if(i%2==0) {cin>>v2[m];m++;}
    }

    ll mode_v1;
    ll mode_v2;

    ll max = 0;
    rep(i,v1.size()){
        num[v1[i]]++;
        if(max <= num[v1[i]]){
            max = num[v1[i]];
            mode_v1 = v1[i];
        }
    }

    ll max2 = 0;
    rep(i,v2.size()){
        num[v2[i]]++;
        if(max2 <= num[v2[i]]){
            max2 = num[v2[i]];
            mode_v2 = v2[i];
        }
    }
    

    ll cnt = 0;

    if(mode_v1==mode_v2){
        ll mode_v12, mode_v22;
        ll maxx = 0;
        rep(i,v1.size()){
            if(maxx <= num[v1[i]] && v1[i] != mode_v1){
                maxx = num[v1[i]];
                mode_v12 = v1[i];
            }
        }
        
        ll maxx2 = 0;
        rep(i,v2.size()){
            if(maxx2 <= num[v2[i]] && v2[i] != mode_v2){
                maxx2 = num[v2[i]];
                mode_v22 = v2[i];
            }
        }

        
        ll gg1 =0, mm1 =0;

        rep(i,n){
            if(i%2==1){
                if(v1[gg1] != mode_v1) {cnt++;}
                gg1++;
            }
            if(i%2==0){
                if(v2[mm1] != mode_v22) {cnt++;}
                mm1++;
            }
        }

        ll gg =0, mm =0;
        ll cnt2 =0;

        rep(i,n){
            if(i%2==1){
                if(v1[gg] != mode_v12) {cnt2++;}
                gg++;
            }
            if(i%2==0){
                if(v2[mm] != mode_v2) {cnt2++;}
                mm++;
            }
        }        

        cout<<min(cnt,cnt2)<<endl;
        return 0;

    }else{
        ll gg =0, mm =0;

        rep(i,n){
            if(i%2==1){
                if(v1[gg] != mode_v1) {cnt++;}
                gg++;
            }
            if(i%2==0){
                if(v2[mm] != mode_v2) {cnt++;}
                mm++;
            }
        }
    }

    cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 4776