import qualified Data.Map as MP
import qualified Data.ByteString.Char8 as BC
import qualified Data.Vector.Unboxed as VU
import Data.Char
import Data.List

type Count = MP.Map Int Int

step :: (Count, Count) -> (Int,Int) -> (Count, Count)
step (emp,omp) (i,e)
    | even i = (emp', omp)
    | odd i = (emp, omp')
    where
        emp' = MP.adjust (+1) e emp
        omp' = MP.adjust (+1) e omp

solve :: Count -> Count -> Int -> Int
solve emp omp n
    | ek1 == ok1 = min (n-ev1-ov2) (n-ev2-ov1)
    | otherwise = n-ev1-ov1
    where
        ((ev1,ek1):(ev2,ek2):[]) = take 2 $ getList emp
        ((ov1,ok1):(ov2,ok2):[]) = take 2 $ getList omp

        getList :: Count -> [(Int, Int)]
        getList mp = sortBy (flip compare) $ MP.foldlWithKey (\acc k v  -> (v,k):acc) [] mp

main = do
    n <- readLn :: IO Int
    xs <- VU.unfoldrN n (BC.readInt . BC.dropWhile isSpace) <$> BC.getLine
    
    let
        base = VU.foldl' (\m k -> MP.insert k 0 m) MP.empty $ VU.fromList [1..10^5]
        (emp,omp) = VU.foldl' step (base, base) $ VU.zip (VU.fromList [1..n]) xs
        res = solve emp omp n
    
    print res