#include<bits/stdc++.h>
using namespace std;
vector<int> a(100001),b(100001);

int main(){
  int n;
  cin >> n;
  vector<int> A(n/2),B(n/2);
  for(int i=0;i<n/2;i++){cin >> A[i] >> B[i];}
  for(int i=0;i<=100000;i++){a[i]=0; b[i]=0;}
  for(int i=0;i<n/2;i++){a[A[i]]++; b[B[i]]++;}
  vector<pair<int,int>> q(100000),w(100000);
  for(int i=1;i<100000;i++){q[i]=make_pair(a[i],i); w[i]=make_pair(b[i],i);}
  sort(q.begin(),q.end()); sort(w.begin(),w.end());
  reverse(q.begin(),q.end()); reverse(w.begin(),w.end());
  int ans=0;
  if(q[0].second!=w[0].second){ans=n-(q[0].first+w[0].first);}
  else{
    int m=n-(q[1].first+w[0].first);
    int l=n-(q[0].first+w[1].first);
    ans=min(m,l);
  }
  cout << ans << endl;
}