(function(input) {
  'use strict';
  const INPUT = input.split("\n")
  for(let i = 0; i<INPUT.length; i=i+2){
    if(!INPUT[i] || !INPUT[i+1]) continue
    if (INPUT[i] === 2) {
      console.log('0')
      continue
    }
    const length = INPUT[i]
    const line = INPUT[i+1].split(" ")
    let Max = 0
    let MaxNumFirst = ''
    let SecmaxNumFirst = ''
    let countHashFirst = {}
    for(let j=0; j< length; j=j+2){
      countHashFirst[line[j]]
      ? countHashFirst[line[j]]++
      : countHashFirst[line[j]]=1
      if(countHashFirst[line[j]] >= Max){
        SecmaxNumFirst = MaxNumFirst
        Max = countHashFirst[line[j]]
        MaxNumFirst = line[j]
      }
    }

    Max = 0
    let MaxNumSecond = ''
    let SecmaxNumSecond = ''
    let countHashSecond = {}
    for(let j=1; j< length; j=j+2){
      countHashSecond[line[j]]
      ? countHashSecond[line[j]]++
      : countHashSecond[line[j]]=1
      if(countHashSecond[line[j]] >= Max){
        SecmaxNumSecond = MaxNumSecond
        Max = countHashSecond[line[j]]
        MaxNumSecond = line[j]
      }
    }

    if(MaxNumFirst==MaxNumSecond) {
      let resA = 0
      let resB = 0
      if(SecmaxNumFirst == MaxNumSecond) {
        SecmaxNumFirst = 0
      }
      for(let j=0; j< length; j=j+2){
        if(SecmaxNumFirst != line[j]) resA++
        if(MaxNumSecond != line[j+1]) resA++
      }
      if(SecmaxNumSecond == MaxNumFirst) {
        SecmaxNumSecond = 0
      }
      for(let j=0; j< length; j=j+2){
        if(SecmaxNumSecond != line[j+1]) resB++
        if(MaxNumFirst != line[j] ) resB++
      }
      console.log(resA > resB ? resB : resA)
    } else {
      let res = 0
      for(let j=0; j< length; j=j+2){
        if(MaxNumFirst != line[j]) res++
        if(MaxNumSecond != line[j+1]) res++
      }
      console.log(res)
    }
 
    
  }
})(require('fs').readFileSync('/dev/stdin', 'utf8'))