type ABC(stream:System.IO.TextReader) =
  member this.Scan1 f = stream.ReadLine() |> f
  member this.Scan2 f = stream.ReadLine().Split() |> Array.map f |> (fun a -> (a.[0], a.[1]))
  member this.Scan3 f = stream.ReadLine().Split() |> Array.map f |> (fun a -> (a.[0], a.[1], a.[2]))
  member this.Scan4 f = stream.ReadLine().Split() |> Array.map f |> (fun a -> (a.[0], a.[1], a.[2], a.[3]))
  member this.ScanVecH f = stream.ReadLine().Split() |> Array.map f
  member this.ScanVecV n f = [| for i in 1..n -> stream.ReadLine() |> f |]
  member this.ScanMatrix n f  = [| for i in 1..n -> stream.ReadLine().Split() |> Array.map f |]
  member this.ScanCharMatrix n = [| for i in 1..n -> stream.ReadLine().ToCharArray() |]
  member this.Close () = stream.Close()

let util = ABC(stdin)

let analyze xs =
  let r = xs
          |> Array.countBy id
          |> Array.sortByDescending (fun (k,v) -> v)
  let n1, cnt1 = Array.head r
  let n2, cnt2 = Array.tryItem 1 r |> function | Some (a,b) -> (a,b) | None -> ("114514" , 0)
  (n1, cnt1, cnt2)



// 入力
util.Scan1 id |> ignore
let zs = util.ScanVecH id |> Array.chunkBySize 2
let xs = zs |> Array.map (Array.item 0)
let ys = zs |> Array.map (Array.item 1)

let n1, cnt1, cnt2 = analyze xs
let m1, cnt3, cnt4 = analyze ys
match n1 = m1 with
| false -> 2 * xs.Length - cnt1 - cnt3
| true -> 2 * xs.Length - cnt1 - (max cnt2 cnt4)
|> printfn "%d"

util.Close()
