#include "bits/stdc++.h"
#define rep(i,a,n) for(int i = (a);i < (n);i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

int main(){
	int n,maxa1[2] = {0},maxa2[2] = {0},maxb1[2] = {0},maxb2[2] = {0};
  	cin >> n;
  	int a[n],cnt_a[500001] = {0},cnt_b[500001] = {0};
  	bool flag = false;
  
  	rep(i,0,n){
      cin >> a[i];
      if(i % 2 == 0){
        cnt_a[a[i]]++;
      }
      else{
        cnt_b[a[i]]++;
      }
    }
  
  	rep(i,0,500001){
      
      	if(cnt_a[i] > maxa1[0] && cnt_b[i] > maxb1[0]){
          if(maxa1[0] < maxb1[0]){
            if(cnt_a[i] >= maxa1[0]){
              maxa2[0] = maxa1[0];
              maxa1[0] = cnt_a[i];
            }
            else if(cnt_a[i] >= maxa1[0]){
              maxa2[0] = cnt_a[i];
            }
          }
          else if(maxa1[0] > maxb1[0]){
            if(cnt_b[i] >= maxb1[0]){
              maxb2[0] = maxb1[0];
              maxb1[0] = cnt_b[i];
            }
            else if(cnt_b[i] >= maxb1[0]){
              maxb2[0] = cnt_b[i];
            }
          }
          else if(maxa2[0] > maxb2[0]){
            if(cnt_b[i] >= maxb1[0]){
              maxb2[0] = maxb1[0];
              maxb1[0] = cnt_b[i];
            }
            else if(cnt_b[i] >= maxb1[0]){
              maxb2[0] = cnt_b[i];
            }
          }
          else if(maxa2[0] < maxb2[0]){
            if(cnt_a[i] >= maxa1[0]){
              maxa2[0] = maxa1[0];
              maxa1[0] = cnt_a[i];
            }
            else if(cnt_a[i] >= maxa1[0]){
              maxa2[0] = cnt_a[i];
            }
          }
          else{
            flag = true;
            if(cnt_a[i] >= maxa1[0]){
              maxa2[0] = maxa1[0];
              maxa1[0] = cnt_a[i];
            }
            else if(cnt_a[i] >= maxa1[0]){
              maxa2[0] = cnt_a[i];
            }
          }
        }
      	else{
          if(cnt_a[i] >= maxa1[0]){
            maxa2[0] = maxa1[0];
            maxa1[0] = cnt_a[i];
          }
          else if(cnt_a[i] >= maxa1[0]){
            maxa2[0] = cnt_a[i];
          }
          if(cnt_b[i] >= maxb1[0]){
            maxb2[0] = maxb1[0];
            maxb1[0] = cnt_b[i];
          }
          else if(cnt_b[i] >= maxb1[0]){
            maxb2[0] = cnt_b[i];
          }
        }
    }
  
  
  	if(flag){
      
      rep(i,0,500001){
      
      	if(cnt_a[i] > maxa1[1] && cnt_b[i] > maxb1[1]){
          if(maxa1[1] < maxb1[1]){
            if(cnt_a[i] >= maxa1[1]){
              maxa2[1] = maxa1[1];
              maxa1[1] = cnt_a[i];
            }
            else if(cnt_a[i] >= maxa1[1]){
              maxa2[1] = cnt_a[i];
            }
          }
          else if(maxa1[0] > maxb1[1]){
            if(cnt_b[i] >= maxb1[1]){
              maxb2[1] = maxb1[1];
              maxb1[1] = cnt_b[i];
            }
            else if(cnt_b[i] >= maxb1[1]){
              maxb2[0] = cnt_b[i];
            }
          }
          else if(maxa2[1] > maxb2[1]){
            if(cnt_b[i] >= maxb1[1]){
              maxb2[1] = maxb1[1];
              maxb1[1] = cnt_b[i];
            }
            else if(cnt_b[i] >= maxb1[1]){
              maxb2[1] = cnt_b[i];
            }
          }
          else if(maxa2[1] < maxb2[1]){
            if(cnt_a[i] >= maxa1[1]){
              maxa2[1] = maxa1[1];
              maxa1[1] = cnt_a[i];
            }
            else if(cnt_a[i] >= maxa1[1]){
              maxa2[1] = cnt_a[i];
            }
          }
          else{
            flag = true;
            if(cnt_b[i] >= maxb1[1]){
              maxb2[1] = maxb1[1];
              maxb1[1] = cnt_b[i];
            }
            else if(cnt_b[i] >= maxb1[1]){
              maxb2[1] = cnt_b[i];
            }
          }
        }
      	else{
          if(cnt_a[i] >= maxa1[1]){
            maxa2[1] = maxa1[1];
            maxa1[1] = cnt_a[i];
          }
          else if(cnt_a[i] >= maxa1[1]){
            maxa2[1] = cnt_a[i];
          }
          if(cnt_b[i] >= maxb1[1]){
            maxb2[1] = maxb1[1];
            maxb1[1] = cnt_b[i];
          }
          else if(cnt_b[i] >= maxb1[1]){
            maxb2[1] = cnt_b[i];
          }
        }
    }
      
      cout << min((n/2 - maxa1[0])+(n/2 - maxb1[0]),(n/2 - maxa1[1])+(n/2 - maxb1[1])) << endl;
    }
  	else{
      cout << (n/2 - maxa1[0])+(n/2 - maxb1[0]) << endl;
    }
  	
  	
	return 0;
}

Measured memory_bytes: 4480