#include<bits/stdc++.h>
using namespace::std;
typedef long long lint;
typedef long double ldouble;
#define rep(i, n) for(lint i = 0; i < (lint)(n); i++)
#define repi(i,a,b) for(lint i=lint(a);i<lint(b);i++)
#define rep2(i,a,b,c) for(lint i=lint(a);i>lint(b);i+=c)
#define all(x) (x).begin(),(x).end()
#define sl(c) (('a')<=(c)&&(c)<=('z'))
#define ll(c) (('A')<=(c)&&(c)<=('Z'))
#define PI 3.141592653589793
#define cout (cout<<fixed<<setprecision(15))
#define makeupper(t) (transform(all(t),t.begin(),::toupper))
#define makelower(t) (transform(all(t),t.begin(),::tolower))
#define dist(x1,y1,x2,y2) (pow(pow(x2-x1,2)+pow(y2-y1,2),0.5))
#define sum(a) accumulate(all(a),0)
#define NEXT_LINE string junk; getline(cin, junk);
#define output(v,s) do{rep(i,v.size())cout<<(i?s:"")<<v[i];cout<<"\n";}while(0)
inline string replace(string str, string before, std::string after) {
	string::size_type  Pos(str.find(before));
	while (Pos != std::string::npos) {
		str.replace(Pos, before.length(), after);
		Pos = str.find(before, Pos + after.length());
	}
	return str;
}
inline vector<string> split(string &s, string delim) {
	vector<string> elems;
	s=replace(s, "#", "HASH");
	s=replace(s, delim,"#");
	stringstream ss(s);
	string item;
	while (getline(ss, item, '#')) {
		elems.push_back(replace(item, "HASH", "#"));
	}
	return elems;
}
inline vector<int> cross(vector<int> a, vector<int> b) {
    return { a[1] * b[2] - a[2] * b[1],a[2] * b[0] - a[0] * b[2],a[0] * b[1] - a[1] * b[0] };
}
inline int GCD(int a, int b) {
    if (a < b)swap(a, b);
    if (a%b != 0)GCD(b, a%b);
    else return b;
}
inline vector<lint> primeList(lint n) {
    vector<bool> p(n+1);
    vector<lint> list;
    repi(i,1, n+1)p[i] = true;
    repi(i,2,sqrt(n)+1) {
        if (p[i]) {
            repi(j,2,n/i+1) {
                p[i*j] = false;
            }
        }
    }
    repi(i, 2, n+1)if (p[i])list.push_back(i);
    return list;
}
inline bool isPrime(int num){
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2){
        if (num % i == 0)return false;
    }
    return true;
}
inline lint max(vector<lint> num){
    lint M=num[0];
    rep(i,num.size())M=max(M,num[i]);
    return M;
}
inline lint min(vector<lint> num){
    lint M=num[0];
    rep(i,num.size())M=min(M,num[i]);
    return M;
}
template<typename T>class Stack{
    vector<T> stack;
    public:
        void push(T num) {
            stack.push_back(num);
        }
        T pop() {
            T num = stack[stack.size() - 1];
            stack.erase(stack.end() - 1);
            return num;
        }
};
template<typename T>class Queue{
    deque<T> queue;
    public:
        void push(T num) {
            queue.push_front(num);
        }
		void push_back(T num){
			queue.push_back(num);
		}
        T pop() {
            T num = queue[queue.size()-1];
            queue.pop_back();
            return num;
        }
        bool empty(){
            return queue.empty();
        }
};
int main() {
    lint n;
    cin>>n;
    vector<lint> a(n);
    rep(i,n)cin>>a[i];
    map<lint,lint> list,list2;
    rep(i,n){
        if(i%2==0){
            if(list.find(a[i])!=list.end()){
                list[a[i]]++;
            }else{
                list[a[i]]=1;
            }
        }
        else{
            if(list2.find(a[i])!=list2.end()){
                list2[a[i]]++;
            }else{
                list2[a[i]]=1;
            }
        }
    }
    lint M=0,M2=0,M3=0,M4=0;
    vector<lint> keyList,keyList2;
    for(const auto& m:list){
        M=max(M,m.second);
    }
    for(const auto& m:list){
        if(M==m.second)keyList.push_back(m.first);
    }
    for(const auto& m:list2){
        M2=max(M2,m.second);
    }
    for(const auto& m:list2){
        if(M==m.second)keyList2.push_back(m.first);
    }
    if(keyList.size()!=1||keyList2.size()!=1||keyList[0]!=keyList2[0]){
        cout<<n-M-M2;
        return 0;
    }
    for(const auto& m:list){
        if(m.second!=M)M3=max(M3,m.second);
    }
    for(const auto& m:list2){
        if(m.second!=M2)M4=max(M4,m.second);
    }
    cout<<min(n-M-M4,n-M2-M3);
}

Measured memory_bytes: 8444