//new.cpp
/*
Author : Hocky Yudhiono
Sab 29 Sep 2018 06:55:53  WIB
Current Local Time : 18:55:53

getchar_unlocked > getchar > cin without sync > scanf > cin with sync
bool operator<(const MyStruct& rhs) const
*/

#include <algorithm>
#include <iostream>
#include <stdlib.h>
#include <cstring>
#include <iomanip>
#include <string>
#include <vector>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>

using namespace std;

#if 0
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize(3)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target("sse3","sse2","sse")
#pragma GCC target("avx","sse4","sse4.1","sse4.2","ssse3")
#pragma GCC target("f16c")
#pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector")
#pragma GCC diagnostic error "-fwhole-program"
#pragma GCC diagnostic error "-fcse-skip-blocks"
#pragma GCC diagnostic error "-funsafe-loop-optimizations"
#pragma GCC diagnostic error "-std=c++14"
#pragma GCC target ("string"...)
#pragma GCC push_options
#pragma GCC pop_options
#pragma GCC reset_options
#pragma GCC optimize ("O3")
#endif

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;

#define mp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define remove erase
//Remember to undefine if the problem is interactive
#define endl '\n'
#define DEBUG(X) cout << ">>> DEBUG(" << __LINE__ << ") " << #X << " = " << (X) << endl

const double eps = 1e-9;
const int INFMEM = 63;
const int INF = 1061109567;
const LL LINF = 4557430888798830399LL;
const double DINF = numeric_limits<double>::infinity();
const LL MOD = 1000000007;
const int dx[8] = {1,0,-1,0,1,1,-1,-1};
const int dy[8] = {0,1,0,-1,1,-1,1,-1};
const double PI = 3.141592653589793;

#ifdef _WIN32
#define getchar_unlocked getchar
#endif
#define GETCHAR getchar_unlocked
inline void fastin(int &input_number) 
{
  input_number = 0;
  int ch = GETCHAR();
  //if(ch == EOF) exit(0);
  int sign = 1;
  while(ch < '0' || ch > '9'){
    if(ch == '-') sign=-1;
    ch = GETCHAR();
  }
  while(ch >= '0' && ch <= '9'){
    input_number = (input_number << 3)+(input_number << 1) + ch-'0';
    ch = GETCHAR();
  }
  input_number *= sign;
}

inline void fastll(LL &input_number) 
{
  input_number = 0;
  int ch = GETCHAR();
  //if(ch == EOF) exit(0);
  int sign = 1;
  while(ch < '0' || ch > '9'){
    if(ch == '-') sign=-1;
    ch = GETCHAR();
  }
  while(ch >= '0' && ch <= '9'){
    input_number = (input_number << 3)+(input_number << 1) + ch-'0';
    ch = GETCHAR();
  }
  input_number *= sign;
}

inline void fastch(char &ch) 
{
  ch = GETCHAR();
  //if(ch == EOF) exit(0);
  while(ch == ' ' || ch == '\n')
    ch = GETCHAR();
}

inline void open(string a){
  freopen((a+".in").c_str(),"r",stdin);
  freopen((a+".out").c_str(),"w",stdout);
}

inline void fasterios(){
  //Do not use if interactive
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

struct dt{
	LL idx,val;
	bool operator <(const dt &other)const{
		return val > other.val;
	}
};
LL n,ans;
LL isi[100005];
dt odd[100005];
dt even[100005];

int main(){
    cin >> n;
    LL batas = n/2;
    for(int i = 1;i <= n;i++) cin >> isi[i];
    for(int i = 1;i <= n;i += 2){
    	// cout << isi[i] << endl;
    	odd[isi[i]].val++;
    	odd[isi[i]].idx = isi[i];
    }
    for(int i = 2;i <= n;i += 2){
    	even[isi[i]].val++;
    	even[isi[i]].idx = isi[i];
    }
    sort(odd+1,odd+100003);
    // cout << odd[1].idx << " " << odd[1].val << endl;
    sort(even+1,even+100003);
    // for(int i = 1;i <= n;i++) cout << even[i].idx << endl;
   	if(odd[1].idx != even[1].idx){
   		// cout << odd[1].val << " " << odd[1].idx << " " << even[1].val << " " << even[1].idx << endl;
   		ans = batas-odd[1].val+batas-even[1].val;
   	}
   	else{
   		// cout << "here" << endl;
   		ans = min(batas-odd[1].val+batas-even[2].val,batas-odd[2].val+batas-even[1].val);
   	}
   	cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4096