'use strict';

function Main(input) {
  const N = Number(input.split("\n")[0]);
  const line = input.split("\n")[1].split(" ").map(x => Number(x));
  let lineA = [];
  let lineB = [];
  let lineA_counter = {};
  let lineB_counter = {};
  let counter = 0;

  for(let i=0; i<N; i+=2) {
    lineA.push(line[i]);
    lineB.push(line[i+1]);
  }

  for(let i=0; i<N/2; i++) {
    if(lineA_counter[String(lineA[i])] == null) {
      lineA_counter[String(lineA[i])] = 1;
    } else {
      lineA_counter[String(lineA[i])]++;
    }
    if(lineB_counter[String(lineB[i])] == null) {
      lineB_counter[String(lineB[i])] = 1;
    } else {
      lineB_counter[String(lineB[i])]++;
    }
  }

  const howmax = (list) => {
    let valuelist = [];
    for(let key in list) {
      valuelist.push(list[key]);
    }
    return  Math.max.apply(null, valuelist);
  }

  const wheremax = (list, max) => {
    for(let key in list) {
      if(list[key] === max) {
        return key;
      }
    }
  }

  let maxA = howmax(lineA_counter);
  let maxA_index = wheremax(lineA_counter, maxA); // 何にあわせるべきかわかる
  let maxB = howmax(lineB_counter);
  let maxB_index = wheremax(lineB_counter, maxB);

  const calc = () => {
    lineA_counter[maxA_index] = 0;
    lineB_counter[maxB_index] = 0;
    for(let key in lineA_counter) {
      counter += lineA_counter[key];
    }
    for(let key in lineB_counter) {
      counter += lineB_counter[key];
    }
    return counter;
  }


  if(maxA_index != maxB_index) {
    console.log(calc());
  } else if(maxA >= maxB) {
    // Bは２番めに大きい数を探す必要がある
    let tmp = lineB_counter[maxB_index];
    lineB_counter[maxB_index] = 0;
    maxB = howmax(lineB_counter);
    maxB_index = wheremax(lineB_counter, maxB);
    console.log(calc() + tmp);
  } else {
    let tmp = lineA_counter[maxA_index];
    lineA_counter[maxA_index] = 0;
    maxA = howmax(lineA_counter);
    maxA_index = wheremax(lineA_counter, maxA);
    console.log(calc() + tmp);
  }


};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
