import Data.List

comb :: [Int] -> ([Int], [Int])
comb []         = ([], [])
comb (x1:x2:xs) = (x1:l1, x2:l2)
 where (l1, l2) = comb xs
 
maxElN :: [Int] -> Int
maxElN xs = maximum $ map length $ group xs
 
main = do
  n  <- read <$> getLine
  vs <- map read.words <$> getLine
  let (l1, l2) = comb vs
  if length (nub vs) == 1
  then print $ length vs `div` 2
  else print $ n - maxElN l1 - maxElN l2