let _ = int_of_string (read_line())
let s = read_line()
let vs = Str.split (Str.regexp " ") s |> List.map int_of_string
let rec loop = function
 | [] -> [],[]
 | [a] -> [a],[]
 | a::b::xs ->
   let aa,bb = loop xs in
   a::aa,b::bb

let vs1,vs2=loop vs
module M = Map.Make(struct type t=int let compare=compare end)

let f vs =
  let (c,_) = List.fold_left(fun (mc,m) v ->
        let c = try M.find v m with _ -> 0 in
        (max(c+1)mc,M.add  v (c+1) m)
  ) (0,M.empty) vs in
  c

let vm1=f vs1
let vm2=f vs2
let n = (List.length vs1-vm1)+(List.length vs2-vm2)
let _ =
  Printf.printf "%d\n" n

~                                            