#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = int64_t;
#define rep(i, j, n) for (int i = j; i < (int)n; ++i)
#define rrep(i, j, n) for (int i = (int)n - 1; j <= i; --i)

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i, 0, n) cin >> a[i];

  unordered_map<int, int> odd, even;
  rep(i, 0, n) {
    if (i & 1)
      odd[a[i]]++;
    else
      even[a[i]]++;
  }

  vector<pair<int, int>> o, e;
  for (auto p : odd) { o.emplace_back(p.second, p.first); }
  for (auto p : even) { e.emplace_back(p.second, p.first); }
  sort(o.rbegin(), o.rend());
  sort(e.rbegin(), e.rend());
  o.emplace_back(0, n / 2);
  e.emplace_back(0, n / 2);

  if (o[0].second == e[0].second) {
    cout << n - o[0].first - max(o[1].first, e[1].first) << endl;
  } else {
    cout << n - o[0].first - e[0].first << endl;
  }
  return 0;
}
#include <iostream>
#include <algorithm>
#include <string>
#include  <queue>
#include <vector>
#include  <cstdio>
#include <cstring>
#include<map>
#include<set>
//#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define I(a) scanf("%d",&a)
#define I2(a,b) scanf("%d%d",&a,&b)
#define I3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define L(a) scanf("%lld",&a)
#define L2(a,b) scanf("%lld%lld",&a,&b)
#define L3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define PI(a) printf("%d",a)
#define PL(a) printf("%lld",a)
#define PT(t) printf("Case %d: ",t)
#define PB push_back
#define x first
#define y second
#define xx first.first
#define xy first.second
#define yx second.first
#define yy second.second
#define SC scanf
#define PC printf
#define NL printf("\n")
#define SET(a) memset(a,0,sizeof a)
#define SETR(a) memset(a,-1,sizeof a)
#define SZ(a) ((int)a.size())-1
#define f(i,a,b) for(int i=a;i<=b; i++)
#define fr(i,a,b) for(int i=a;i<=b; i++)
#define frr(i,a,b) for(int i=a;i>=b; i--)
#define frv(i,a)  for(int i=0;i<a.size();i++)
#define pi 2.0*acos(0.0)
#define R(a) freopen(a, "r", stdin);
#define W(a) freopen(a, "w", stdout);
#define CB(x) __builtin_popcount(x)
#define STN(a) stringtonumber<ll>(a)
#define lol printf("BUG\n")
#define Endl "\n"
#define mk make_pair
using namespace std;
template <class T> inline T BM(T p, T e, T M)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    }
    return (T)ret;
}
template <class T> inline T mul(T p, T e, T M)
{
    ll ret = 0;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret + p) ;
        p = (p + p) ;
        if(ret>=M)ret-=M;
        if(p>=M)p-=M;
    }
    return (T)ret;
}
template <class T> inline T gcd(T a, T b)
{
    if(b == 0)return a;
    return gcd(b, a % b);
}
template <class T> inline T mdINV(T a, T M)
{
    return BM(a, M - 2, M);
}
template <class T> inline T PW(T p, T e)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p);
        p = (p * p);
    }
    return (T)ret;
}
 
 
template <class T>bool ISLEFT(T a, T b, T c)
{
    if(((a.xx - b.xx) * (b.yy - c.yy) - (b.xx - c.xx) * (a.yy - b.yy)) < 0.0)return 1;  //Uporer dike //A,b,c, x okkher ordera sorted
    else return 0;
}
 

#define  mx 200004
#define base 193ll
 
typedef pair<int,int >P;
//////////////////////////
////////////////////////
#define F(i,a,b) for(int i=a;i<b; i++)
#define LL long long
#define MX  200007
#define md 998244353ll
///////////////////////////
///////////////////////////
///

int main(){

  int n;
  I(n);
  vector<int>v[2];
  for(int i = 1;i<=n;i++){
    int x;
    I(x);
    v[i%2].push_back(x);
  }

  int res = 0;

  map<int,int> mp[2];
  set< pair<int, int> >st[2];
  for(int i = 0;i<= 1;i++){
    int ma = 0;
    int cnt = 1;
    for(int j = 0;j<v[i].size();j++){
      mp[i][v[i][j]]++;
    }
  }

  for(int i = 0;i<= 1;i++){
    for(int j = 1;j<v[i].size();j++){
      st[i].insert(mk(-mp[i][v[i][j]], v[i][j]));
    }
  }

  int ans = n;
  int i = 0;
  for(auto it: st[0]){
    i++;
    if(i==3)break;
    int j = 0;
    for(auto it1: st[1]){
      j++;
      if(j==3)break;
      if(it.second == it1.second){
       // cout<<it.first<<" "<<it1.first<<endl;
        ans = min(ans, n - max(-it.first, -it1.first));
      }
      else {
        ans = min(ans, n+it.first +it1.first);
      }
    }
  }

  cout<<ans<<endl;

  return 0;
}