open System
let arrLen = stdin.ReadLine () |> System.Int32.TryParse |> snd
let halfArrLen = arrLen / 2
let numArr =
  let str = stdin.ReadLine ()
  str.Split [|' '|]
  |> Array.map (System.Int32.TryParse >> snd)


let indexedNumArr = Array.zip [|0..arrLen-1|] numArr
let evenArr, oddArr = 
  Array.partition (fun (index, _) -> index % 2 = 0 ) indexedNumArr
let genCountMap arr =
  let increment map num =
    match Map.tryFind num map with
    | Some cnt -> Map.add num (cnt + 1) map
    | None -> Map.add num 1 map
  Array.fold increment Map.empty arr

let evenMap = Array.map (fun (_, num) -> num) evenArr |> genCountMap
let oddMap = Array.map (fun (_, num) -> num) oddArr |> genCountMap

let evenSorted = Map.toList evenMap |> List.sortByDescending (fun (_, cnt) -> cnt) 
let oddSorted = Map.toList oddMap |> List.sortByDescending (fun (_, cnt) -> cnt)

let ans =
  match List.head evenSorted, List.tail evenSorted, List.head oddSorted, List.tail oddSorted with
  | (el1, cnt1), _, (el2, cnt2), _ when el1 <> el2 -> arrLen - cnt1 - cnt2
  | _, [], _, [] -> halfArrLen
  | _, [], _, (_, cnt) :: _ 
  | _, (_, cnt) :: _, _, [] -> arrLen - halfArrLen - cnt
  | (_, cnt1), (_, cnt2) :: _, (_, cnt3), (_, cnt4) :: _ ->
    if cnt2 > cnt4 then arrLen - cnt2 - cnt3
    else arrLen - cnt1 - cnt4
    
printfn "%i" ans