// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <algorithm>

#include <cstring>

#include <string>

#include <map>

using namespace std;

int A[200005], c[200005];

int main()

{

    int n;

    while(~scanf("%d", &n))

    {

        memset(c, 0, sizeof(c));

        int ans = 0, m = 0, a, a2, b, b2;

        for(int i = 1; i <= n; i++)

        {

            scanf("%d", &A[i]);

            m = max(m, A[i]);

        }

        int tmpa = 0, tmpa2 = 0, tmpb = 0, tmpb2 = 0;

        for(int i = 1; i <= n; i += 2)

            c[A[i]]++;

        for(int i = 1; i <= m; i++)

        {

            if(c[i] > tmpa)

            {

                swap(tmpa2, tmpa);

                swap(a, a2);

                tmpa = c[i];

                a = i;

            }

            else if(c[i] > tmpa2)

            {

                tmpa2 = c[i];

                a2 = i;

            }

        }

        memset(c, 0, sizeof(c));

        for(int i = 2; i <= n; i += 2)

            c[A[i]]++;

        for(int i = 1; i <= m; i++)

        {

            if(c[i] > tmpb)

            {

                swap(tmpb2, tmpb);

                swap(b, b2);

                tmpb = c[i];

                b = i;

            }

            else if(c[i] > tmpb2)

            {

                tmpb2 = c[i];

                b2 = i;

            }

        }

        if(a == b)

        {

            ans = n - max(tmpa + tmpb2, tmpb + tmpa2);

        }

        else

            ans = n - tmpa - tmpb;

        printf("%d\n", ans);

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.831809499547364x):
//I read the news today, oh boy

//About a lucky man who made the grade

 

#include <bits/stdc++.h>

#define ff first

#define ss second

#define pb push_back

#define mp make_pair

#define sz(x) ll((x).size())

#define all(v) (v).begin(),(v).end()

#define trace(x) cerr << #x << " = " << x << endl

#define fastio ios_base::sync_with_stdio(0);cin.tie(0)

#define For(i,a,b) for(ll i = ll(a); i < ll(b); ++i)

#define roF(i,a,b) for(ll i = ll(a); i >= ll(b); i--)

using namespace std;



typedef long long ll;

typedef pair<ll,ll> ii;

typedef vector<ll> vi;

typedef vector<ii> vii;



const ll N=1e6;



ll v[N];



int main(){

	fastio;

	int n; cin>>n;

	map<ll,ll> S[2];

	For(i,0,n){

		cin>>v[i];

		S[i&1][v[i]]++;

	}

	int ans = 0;

	if(S[0].size()==1 && S[1].size()==1 && (*S[0].begin()!=*S[1].begin())) ans = 0;

	else{

		if(S[0].size()==1 && S[1].size()==1){

			ans = n/2;

		}else if(S[0].size()==1){

			ll may=0;

			for(auto x: S[1]){

				if(x.ff!=(*S[0].begin()).ff) may = max(x.ss,may);

			}

			ans = n/2-may;

		}else if(S[1].size()==1){

			ll may=0;

			for(auto x: S[0]){

				if(x.ff!=(*S[1].begin()).ff) may = max(x.ss,may);

			}

			ans = n/2-may;

		}else{

			ii best1 = mp(0,0), best2 = mp(0,0);

			for(auto x: S[0]) if(x.ss>best1.ss) best1=x;

			for(auto x: S[1]) if(x.ss>best2.ss) best2=x;

			if(best1.ff!=best2.ff) ans = n - (best1.ss+best2.ss);

			else{

				ii secondbest1 = mp(0,0), secondbest2 = mp(0,0);

				for(auto x: S[0]) if(x.ff!=best1.ff && x.ss>secondbest1.ss)

					secondbest1 = x;

				for(auto x: S[1]) if(x.ff!=best2.ff && x.ss>secondbest2.ss)

					secondbest2 = x;

				ans = n - max(best1.ss+secondbest2.ss,best2.ss+secondbest1.ss);

			}

		}

	}

	cout << ans << endl;

	return 0;

}