var AnalyzeItems = function(Items){
  var Result = {};
  Items.forEach(function(value){
    if(Result[value] == undefined){
      Result[value] = 1;
    } else {
      ++Result[value];
    }
  });
  return Result;
}

var MapToObject = function(MyMap){
  var Result = [];
  Object.keys(MyMap).forEach(function(MyKey){
    Result.push({Item: MyKey, Count: MyMap[MyKey]});
  });
  return Result;
}

var Main = function(Input){
  // 行を分割
  var Lines = Input.split('\n');

  // 配列の要素数と、要素
  var Items = Number(Lines[0]);
  var ItemArr = Lines[1].split(' ').map(function (element){return Number(element);});
  
  // 奇数番目と偶数番目とで分ける
  var Odd = [];
  var Even = [];
  ItemArr.forEach(function(value, index){
    if(index % 2 == 0){
      Odd.push(value);
    } else {
      Even.push(value);
    }
  });
  var OddItems = AnalyzeItems(Odd);
  var EvenItems = AnalyzeItems(Even);

  var OddItems2 = MapToObject(OddItems).sort((a,b) => {
    if(a.Count < b.Count){
      return 1;
    }
    return -1;
  });
  var EvenItems2 = MapToObject(EvenItems).sort((a,b) => {
    if(a.Count < b.Count){
      return 1;
    }
    return -1;
  });

  if(OddItems2.length == 1){
    if(EvenItems2.length == 1){
      if(OddItems2[0].Item == EvenItems2[0].Item){
        console.log(OddItems2[0].Count);
        return;
      } else {
        console.log(0);
        return;
      }
    } else {
      // Oddの番号は1種類だが、Evenの番号が複数種ある場合
      var FirstNumberCount = EvenItems2[0].Count;
      console.log(Items / 2 - FirstNumberCount);
      return;
    }
  } else if(EvenItems2.length == 1){
    // Evenの番号は1種類だが、Oddの番号が複数種ある場合
    var FirstNumberCount = OddItems2[0].Count;
    console.log(Items / 2 - FirstNumberCount);
    return;
  }

  // OddもEvenも複数種の番号を含む場合
  if(OddItems2[0].Item != EvenItems2[0].Item){
    // OddもEvenも最頻出の数字が異なる場合
    var OddCount = Items / 2 - OddItems2[0].Count;
    var EvenCount = Items / 2 - EvenItems2[0].Count;
    console.log(OddCount + EvenCount);
    return;
  } else {
    // 同じ場合
    if(OddItems2[0].Count > EvenItems2[0].Count){
      var OddCount = Items / 2 - OddItems2[0].Count;
      var EvenCount = Items / 2 - EvenItems2[1].Count;
      console.log(OddCount + EvenCount);
      return;
    } else {
      var OddCount = Items / 2 - OddItems2[1].Count;
      var EvenCount = Items / 2 - EvenItems2[0].Count;
      console.log(OddCount + EvenCount);
      return;
    }
  }
}

// Main(require("fs").readFileSync('./180929C.txt', "utf8"));
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
