let kVMax = 100_000
let n = Scanf.scanf " %d" @@ (+) 0
let vs = Array.init n @@ fun _ -> Scanf.scanf " %d" @@ (+) 0
let css = Array.make_matrix 2 (kVMax + 1) 0
let _ =
  if n = 2 then (Printf.printf "%d\n" @@ if vs.(0) = vs.(1) then 1 else 0; exit 0);
  for i = 0 to n - 1 do
    css.(i land 1).(vs.(i)) <- css.(i land 1).(vs.(i)) + 1
  done;
  let max_v, max_c = [|0; 0|], [|0; 0|] in
  for i = 1 to kVMax do
    for j = 0 to 1 do if css.(j).(i) > max_c.(j) then (max_c.(j) <- css.(j).(i); max_v.(j) <- i) done
  done;
  for i = 0 to 1 do Array.sort (fun x y -> y - x) css.(i) done;
  Printf.printf "%d\n" @@ if max_v.(0) <> max_v.(1) then n - max_c.(0) - max_c.(1)
    else n - max (max_c.(0) + css.(1).(1)) (css.(0).(1) + max_c.(1))