#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<sstream>
#include<random>
#include<cassert>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
const int inf = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};
#define ceil(a, b) a / b + !!(a % b)

int main_wa(int n, int a[]) {
    map<int, int> mp;
    for (int i = 0; i < n; i += 2) {
        mp[a[i]]++;
    }
    int mmax[2][2] = {0};
    rep(i, 2) rep(j, 2) mmax[i][j] = -1;
    for (auto e : mp) { //firstがsecond個
        if (e.second > mmax[0][1]) {
            mmax[1][1] = mmax[0][1];
            mmax[1][0] = mmax[0][0];
            mmax[0][1] = e.second;
            
            mmax[0][0] = e.first;
        } else if (e.second > mmax[1][1]) {
            mmax[1][1] = e.second;
            mmax[1][0] = e.first;
        }
    }
    map<int, int> ma;
    for (int i = 1; i < n; i += 2) {
        ma[a[i]]++;
        //cout << a[i] << " ";
    }
    //cout << endl;
    int mmmax[2][2]; rep(i, 2) rep(j, 2) mmmax[i][j] = -1;
    for (auto e: ma) {
        if (e.second > mmmax[0][1]) {
            mmmax[1][1] = mmmax[0][1];
            mmmax[1][0] = mmmax[0][0];
            mmmax[0][1] = e.second;
            
            mmmax[0][0] = e.first;
        } else if (e.second > mmmax[1][1]) {
            mmmax[1][1] = e.second;
            mmmax[1][0] = e.first;
        }
    }
    /*
     rep(i, 2) {
     cout << mmax[i][0] << " " << mmmax[i][0] << endl;
     cout << mmax[i][1] << " " << mmmax[i][1] << endl;
     }
    */
    if (mmax[0][0] != mmmax[0][0]) { //両方1番目使えるよ
        //cout << (n / 2 - mmax[0][1]) + (n / 2 - mmmax[0][1])<< endl;
        return ((n + 1) / 2 - mmax[0][1]) + (n / 2 - mmmax[0][1]);
    } else if (mmax[1][0] == -1 && mmmax[1][0] == -1) {
        //cout << n / 2 << endl;
        return n / 2;
    } else if (mmax[1][0] == -1) {
        // cout << (n / 2 - mmax[0][1]) + (n / 2 - mmmax[1][1])<< endl;
        return (n + 1) / 2 - mmax[0][1] + (n / 2 - mmmax[1][1]);
    } else if (mmmax[1][0] == -1) {
        //cout << (n / 2 - mmax[1][1]) + (n / 2 - mmmax[0][1])<< endl;
        return (n + 1) / 2 - mmax[1][1] + n / 2 - mmmax[0][1];
    } else { //どっちも2番目以降ある
        if (mmax[0][1] > mmmax[0][1]) { //1番目どっち使うか
            //cout << (n / 2 - mmax[1][1]) + (n / 2 - mmmax[1][1])<< endl;
            return ((n + 1) / 2 - mmax[0][1]) + (n / 2 - mmmax[1][1]);
        } else if (mmax[0][1] < mmmax[0][1]) {
            return ((n + 1) / 2 - mmax[1][1]) + (n / 2 - mmmax[0][1]);
        } else { //1番目は等しい
            if (mmax[1][1] > mmmax[1][1]) {
                return ((n + 1) / 2 - mmax[1][1]) + (n / 2 - mmmax[0][1]);
            } else {
                return ((n + 1) / 2 - mmax[0][1]) + (n / 2 - mmmax[1][1]);
            }
            
            
        }
    }
}

int main_ac(int n, int v[]) {
    int Max = 100000;
    int weight1[Max + 1];
    int weight2[Max + 1];
    for (int i = 1; i <= Max; ++i) {
        weight1[i] = 0;
        weight2[i] = 0;
    }
    for (int i = 0; i < n; ++i) {
        if (i % 2 == 0) {
            weight1[v[i]]++;
        } else {
            weight2[v[i]]++;
        }
    }
    int w1 = 0, w2 = 0;
    int id1 = -1, id2 = -1;
    for (int i = 1; i <= Max; ++i) {
        if (w1 < weight1[i]) {
            w1 = weight1[i];
            id1 = i;
        }
        if (w2 < weight2[i]) {
            w2 = weight2[i];
            id2 = i;
        }
    }
    if (id1 != id2) {
        return (n + 1) / 2 - w1 + n / 2 - w2;
    } else {
        if (w1 > w2) {
            w2 = 0;
            for (int i = 1; i <= Max; ++i) {
                if (w2 < weight2[i] && i != id2) {
                    w2 = weight2[i];
                }
            }
        } else if (w1 < w2){
            w1 = 0;
            for (int i = 1; i <= Max; ++i) {
                if (w1 < weight1[i] && i != id1) {
                    w1 = weight1[i];
                }
            }
        } else if (w1 == w2) {
            int w11 = 0, w22 = 0;
            for (int i = 1; i <= Max; ++i) {
                if (w11 < weight1[i] && i != id1) {
                    w11 = weight1[i];
                }
                if (w22 < weight2[i] && i != id2) {
                    w22 = weight2[i];
                }
            }
            if (w11 > w22) {
                w1 = w11;
            } else if (w11 < w22) {
                w2 = w22;
            } else if (w11 == w22) {
                w1 = w11; //どっちでもいいか
            }
        }
    }
    return (n + 1) / 2 - w1 + n / 2 - w2;
}
random_device rnd;
mt19937 mt(rnd());
uniform_int_distribution<> rand100(2, 10);
int main() {
    
    int n; cin >> n;
    int a[n]; rep(i, n) cin >> a[i];
    
    //while (1) {
        /*
         int n = rand100(mt);
         int a[n]; rep(i, n) a[i] = rand100(mt);
        */
        int aa = main_wa(n, a);
        cout << aa << endl;
        //int b = main_ac(n, a);
        //cout << "ans " << aa << " " << b << endl;
        /*
         if (aa != b) {
         cout << n << endl;
         rep(i, n) cout << a[i] << " "; cout << endl;
         break;
         }
    */
    //}
}









Measured memory_bytes: 5376