#include <bits/stdc++.h>

using namespace std;

template<class T>
void sortByFreq(std::vector<T>& v)
{
    std::unordered_map<T, size_t> count;

    for (T i : v) {
        count[i]++;
    }

    std::sort(
        v.begin(), 
        v.end(),
        [&count](T const& a, T const& b) {
        if (a == b) {
            return false;
        }
        if (count[a] > count[b]) {
            return true;
        }
        else if (count[a] < count[b]) {
            return false;
        }
        return a < b;
    });
}
int main(){

    int allnumber;
    cin >> allnumber;
    int num = allnumber/2;

    vector<int> vec_l(num), vec_r(num);

    for( int i=0; i<num; i++ ){
        cin >> vec_l[i];
        cin >> vec_r[i];
    } 

    //頻度別に並び替え
    sortByFreq(vec_l);
    sortByFreq(vec_r);

    int freqL =0, freqR =0, freq2L =0, freq2R =0;
    int freqLnum =0, freqRnum =0, freq2Lnum =0, freq2Rnum =0;
    freqL=vec_l[0];
    freqR=vec_r[0];
    for( int i=0; i<num; i++ ){
        //cout << "i=" << i << "; ";
        if(freqL != vec_l[i]){
            freqLnum = i;
            //cout << "freqLnum=" << freqLnum << "; ";
            freq2L=vec_l[i];
            //cout << "freq2L=" << freq2L << "; " << endl;
            for(int j=i; j<num; j++){
                //cout << "j=" << j << "; ";
                if(freq2L != vec_l[j]){
                    freq2Lnum = j - freqLnum;
                    //cout << "freq2Lnum=" << freq2Lnum << "; " << endl;
                    break;
                }
                if(j == num - 1){
                    freq2Lnum = j + 1;
                    //cout << "yay freq2Lnum=" << freq2Lnum << endl; 
                }
            }
            break;
        }
        if(i == num - 1){
            freqLnum = i + 1;
            //cout << "yay freqLnum=" << freqLnum << endl; 
        }
    } 
    //cout << endl;
    for( int i=0; i<num; i++ ){
        //cout << "i=" << i << "; ";
        if(freqR != vec_r[i]){
            freqRnum = i;
            //cout << "freqRnum=" << freqRnum << "; ";
            freq2R=vec_r[i];
            //cout << "freq2R=" << freq2R << "; " << endl;
            for(int j=i; j<num; j++){
                //cout << "j=" << j << "; ";
                if(freq2R != vec_r[j]){
                    freq2Rnum = j - freqRnum;
                    //cout << "freq2Rnum=" << freq2Rnum << "; " << endl;
                    break;
                }
                if(j == num - 1){
                    freq2Rnum = j + 1;
                    //cout << "yay freq2Rnum=" << freq2Rnum << endl; 
                }
            }
            break;
        }
        if(i == num - 1){
            freqRnum = i + 1;
            //cout << "yay freqRnum=" << freqRnum << endl; 
        }
    }

//右側と左側の数字が同じでなければ、
//	(lnum-freqL)+(rnum-freqR)
    if(freqL != freqR){
        //cout << "logic1" << endl;
        cout << (num - freqLnum) + (num - freqRnum);
        return 0;
    }

//同じなら
//	freq2Lnumとfreq2Rnumを比べて多い方を変更する
    if(freq2Lnum > freq2Rnum){
        //	freq2Lnumが多いなら
        //  (lnum-freq2Lnum)+(rnum-freqRnum)
        //cout << "logic2" << endl;
        cout << (num - freq2Lnum) + (num - freqRnum);
        return 0;
    }else{
        //	freq2Rnumが多いなら
        //	(lnum-freqLnum)+(rnum-freq2Rnum)
        //cout << "logic3" << endl;
        cout << (num - freqLnum) + (num - freq2Rnum);
        return 0;
    }

    return 0;
}


Measured memory_bytes: 2852