#include<iostream>
#include<tuple>
#include<vector>
#include<algorithm>
#include<iterator>
#include<cmath>
#include<functional>
#include<map>
using namespace std;

int main(){
    int N;
    cin >> N;
    map<int, int>  o, e;
    for(int i=0; i<N/2; i++){
        int ot, et;
        cin >> ot;
        cin >> et;
        o[ot]++;
        e[et]++;
    }
    int r = N;
    int ei = 0;
    int oi = 0;
    int so = 0;
    int se = 0;
    int me = 0;
    int mo = 0;
    for (auto it = o.begin(); it != o.end(); it++){
        if(mo < it->second){
            so = mo;
            mo = it->second;
            oi = it->first;
        }else if(so < it -> second){
            so = it->second;
        }
    }
    for (auto it = e.begin(); it != e.end(); it++){
        if(me < it->second){
            se = me;
            me = it->second;
            ei = it->first;
        }else if(so < it -> second){
            se = it->second;
        }
    }
    if(ei == oi){
        if (so == 0 && se == 0){
            r -= N/2;
        }else if(so > se){
            r -= so + me;
        }else{
            r -= se + mo;
        }
    }else{
        r -= me + mo;
    }
    cout << r << endl;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long

int N;
int odd[100010], even[100010];

signed main()
{
    cin >> N;
    for(int i = 0; i < N; i++)
    {
        int a;
        cin >> a;
        if(i & 1) even[a]++;
        else odd[a]++;
    }

    int odd_index = -1, odd_max = -1;
    for(int i = 0; i < 100010; i++)
    {
        if(odd_max < odd[i])
        {
            odd_max = odd[i];
            odd_index = i;
        }
    }

    int even_index = -1, even_max = -1;
    for(int i = 0; i < 100010; i++)
    {
        if(even_max < even[i])
        {
            even_max = even[i];
            even_index = i;
        }
    }
    
    if(even_index != odd_index)
    {
        cout << N - even_max - odd_max << endl;
        return 0;
    }

    int odd_max2 = -1;
    for(int i = 0; i < 100010; i++)
    {
        if(odd_max2 < odd[i] && i != odd_index)
        {
            odd_max2 = odd[i];
        }
    }

    int even_max2 = -1;
    for(int i = 0; i < 100010; i++)
    {
        if(even_max2 < even[i] && i != even_index)
        {
            even_max2 = even[i];
        }
    }

    cout << min(N - even_max - odd_max2, N - even_max2 - odd_max) << endl;

    return 0;
}
