#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>

using namespace std;

int main() {
	int i, j, k;
	int n;
	vector<int>a, b, c;
	bool flag = false;

	cin >> n;

	for (i = 0; i < n; i++) {
		int num;
		cin >> num;

		if (i == 0 || i % 2 == 0) {
			a.push_back(num);
		}
		else  {
			b.push_back(num);
		}
		c.push_back(num);

	}

	for (i = 1; i < c.size(); i++) {
		if (c[i - 1] != c[i]) {
			flag = true;
		}
	}

	if (flag == false) {
		cout << n / 2 << endl;
		getchar();
		getchar();
		return 0;
	}

	map<int, int>mpa, mpb;

	
	for (i = 0; i < a.size(); i++) {
		if (mpa.count(a[i]) == 0) {
			mpa.insert(make_pair(a[i], 1));
		}
		else {
			mpa[a[i]]++;
		}
	}

	
	for (i = 0; i < b.size(); i++) {
		if (mpb.count(b[i]) == 0) {
			mpb.insert(make_pair( b[i], 1));
		}
		else {
			mpb[b[i]]++;
		}
	}
	int amax = 0, bmax = 0;
	int aa, bb;

	
	vector<pair<int,int>>aso, bso;
	
	for (auto itr = mpa.begin(); itr != mpa.end(); itr++) {
		aso.push_back(make_pair((*itr).second, (*itr).first));  //aso firstは何個あるか secondeは何の数字か
		if (amax < (*itr).second) {
			aa = (*itr).first;
			amax = (*itr).second;
			//aso.push_back(make_pair(amax, aa));
		}
	}

	for (auto itr = mpb.begin(); itr != mpb.end(); itr++) {
		bso.push_back(make_pair((*itr).second, (*itr).first));
		if (bmax < (*itr).second) {
			bb = (*itr).first;
			bmax = (*itr).second;
			//bso.push_back(make_pair(bmax, bb));
		}
	}

	sort(aso.begin(), aso.end());
	sort(bso.begin(), bso.end());

	if (aa == bb) {
		if (amax > bmax) {
			bb = bso[bso.size() - 2].second;
		}
		else if (amax < bmax) {
			aa = aso[aso.size() - 2].second;
		}
		else if (amax == bmax) {
			bool flag2 = false;
			int cc = 2;

			if (aso[aso.size() - cc].first < bso[bso.size() - cc].first) {
				bb = bso[bso.size() - cc].second;
				flag2 = true;
			}
			else if (aso[aso.size() - cc].first > bso[bso.size() - cc].first) {
				aa = aso[aso.size() - cc].second;
				flag2 = true;
			}
		}
		/*
		else if (amax == bmax) {
			bool flag2 = false;
			int cc = 2;
			while (true)
			{

				if (aso[aso.size() - cc].first > bso[bso.size() - cc].first) {
					bb = bso[bso.size() - cc].second;
					flag2 = true;
				}
				else if (aso[aso.size() - cc].first < bso[bso.size() - cc].first) {
					aa = aso[aso.size() - cc].second;
					flag2 = true;
				}

				if (flag2 == true) break;
				cc++;
				if (aso.size() - cc < 0) {
					cc=2;
					aa = aso[aso.size() - cc].second;
					break;
				}
				else if (bso.size() - cc < 0) {
					cc=2;
					bb = bso[bso.size() - cc].second;
					break;
				}
			}
		}*/
		
	}

	int cnt = 0;

	if (amax > bmax) {
		for (i = 0; i < c.size(); i++) {
			if ((i == 0 || i % 2 == 0) && c[i] != aa) {
				cnt++;
			}
			else if (( i % 2 == 1) && c[i] != bb) {
				cnt++;
			}
		}
	}
	else if (amax <= bmax) {
		for (i = 0; i < c.size(); i++) {
			if ((i == 0 || i % 2 == 0) && c[i] != aa) {
				cnt++;
			}
			else if ((i % 2 == 1) && c[i] != bb) {
				cnt++;
			}
		}
	}

	cout << cnt << endl;
	



	getchar();
	getchar();
	return 0;
}

Measured memory_bytes: 6900