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

    MaxPair = MaxPair.split(',')
    let res = 0
    for(let j=0; j< length; j=j+2){
      if(MaxPair[0] != line[j]) res++
      if(MaxPair[1] != line[j+1]) res++
    }
    console.log(res)
  }
})(require('fs').readFileSync('./stdin', 'utf8'))