#ifdef _WIN32
#include "stdc++.h"
#else
#include <bits/stdc++.h>
#endif

// 継承可能な型
template <class Type>
struct IN : Type
{
	IN()
	{
		std::cin >> *this;
	}
};

// 継承不可能な型
template <class Type>
struct IN_
{
	Type val;

	IN_()
	{
		std::cin >> val;
	}

	operator Type&()
	{
		return val;
	}

	IN_<Type>& operator=(const Type& _value)
	{
		val = _value;
		return *this;
	}
};

template <class Char, class Type>
std::basic_ostream<Char>& operator <<(std::basic_ostream<Char>& os, const IN_<Type>& value)
{
	return os << value.val;
}

template <class Char, class Type>
std::basic_istream<Char>& operator >>(std::basic_istream<Char>& is, IN_<Type>& value)
{
	return is >> value.val;
}

template <class Type>
void OUT(const Type& value)
{
	std::cout << value << std::endl;
}

template <class Type, class ... Args>
void OUT(const Type& value, const Args& ... args)
{
	std::cout << value << ' ';
	OUT(args...);
}

void YES()
{
	OUT("YES");
}
void NO()
{
	OUT("NO");
}
void YESNO(const bool cond)
{
	OUT(cond ? "YES" : "NO");
}

void Yes()
{
	OUT("Yes");
}
void No()
{
	OUT("No");
}
void YesNo(const bool cond)
{
	OUT(cond ? "Yes" : "No");
}

using ll = long long;
using inll = IN_<ll>;
using vll = std::vector<ll>;
using setll = std::set<ll>;
using msetll = std::multiset<ll>;
using instr = IN<std::string>;

// 階乗を計算 O(N) (N=10^7 で O(10^7))
ll factorial(ll n)
{
	for (ll i = n - 1; i > 1; --i)
		n *= i;
	return n;
}

// nCrを計算 O(N) (N=10^7 で O(10^7))
ll ncr(const ll n, ll r)
{
	if (r * 2 > n) r = n - r;

	ll dividend = 1, divisor = 1;

	for (ll i = 1; i <= r; ++i) {
		dividend *= n - i + 1;
		divisor *= i;
	}

	return dividend / divisor;
}

// 素数判定 O(sqrt(N)) (N=10^7 で O(10^3))
bool isprime(const ll num)
{
    if (num < 2) return false;
    if (num == 2) return true;
    if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (ll i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0) return false;
    }

    return true;
}

// 各桁の和を計算 O(logN) (N=10^7 で O(7))
ll digsum(ll n)
{
	ll sum = 0;
	while(n != 0){
		sum += n % 10;
		n /= 10;
	}
	return sum;
}

#define FOR(i, m, n) for (ll (i) = (m); (i) < (n); ++(i))
#define REP(i, n) for (ll (i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for (ll (i) = (n); (i) >= 0; --(i))
#define ITRREP(it, v) for (auto (it) = (v).begin(); (it) != (v).end(); ++(it))
#define ITRREPR(it, v) for (auto (it) = (v).rbegin(); (it) != (v).rend(); ++(it))
#define DIVUP(a, b) (((a) + (b) - 1) / (b))

void Main();

int main()
{
	std::cin.tie(nullptr);
	std::ios::sync_with_stdio(false);

	Main();

#ifdef _DEBUG
	system("pause");
#endif

	return 0;
}

using namespace std;

//////////////////////////////

void Main()
{
	inll n;

	unordered_map<ll, ll> m1;
	unordered_map<ll, ll> m2;
	REP(i, n)
	{
		inll v_;
		if (i % 2 == 0)
		{
			if (m1.count(v_) == 1) m1[v_]++;
			else m1.emplace(v_, 1);
		}
		else
		{
			if (m2.count(v_) == 1) m2[v_]++;
			else m2.emplace(v_, 1);
		}
	}
	
	ll mxk1 = 0, mxk2 = 0;
	ll mx1 = 0, mx2 = 0;
	for (auto& a : m1)
	{
		if (a.second > mx1)
		{
			mxk1 = a.first;
			mx1 = a.second;
		}
	}
	for (auto& a : m2)
	{
		if (a.second > mx2)
		{
			mxk2 = a.first;
			mx2 = a.second;
		}
	}

	if (mxk1 == mxk2)
	{
		if (mx1 > mx2)
		{
			ll old = mxk2;
			mx2 = 0;
			for (auto& a : m2)
			{
				if (a.second > mx2 && a.first != old)
				{
					mx2 = a.second;
				}
			}
		}
		else if (mx1 < mx2)
		{
			ll old = mxk1;
			mx1 = 0;
			for (auto& a : m1)
			{
				if (a.second > mx1 && a.first != old)
				{
					mx1 = a.second;
				}
			}
		}
		else
		{
			ll mx1_ = 0;
			for (auto& a : m1)
			{
				if (a.second > mx1_ && a.first != mxk1)
				{
					mx1_ = a.second;
				}
			}

			ll mx2_ = 0;
			for (auto& a : m2)
			{
				if (a.second > mx2_ && a.first != mxk2)
				{
					mx2_ = a.second;
				}
			}

			if (mx1_ > mx2_)
			{
				return OUT(n - (mx1_ + mx2));
			} else
			{
				return OUT(n - (mx1 + mx2_));
			}
		}
	}

	OUT(n - (mx1 + mx2));
}


Measured memory_bytes: 4376