main :: IO()
main = do
    tileIntLs <- map read . words <$> getLine
    print $ countTrueMatch $ map convertToBool tileIntLs







--[True,False,True....]とのマッチ要素数か、アンマッチ要素数のうち、小さいほうを返す。
countTrueMatch :: [Bool] -> Int
countTrueMatch ls 
    | a > div (length ls) 2		= (length ls) - a
    | otherwise					= a
    where a = countMatch ls (makeZebra True (length ls))


countMatch :: [Bool] -> [Bool] -> Int
countMatch [] _ = 0
countMatch _ [] = 0
countMatch ls1 ls2 =
    if head ls1 == head ls2
        then 1 + countMatch (tail ls1) (tail ls2)
        else countMatch (tail ls1) (tail ls2)


convertToBool :: Int -> Bool
convertToBool num = if (num == 1) then True else False 


makeZebra :: Bool -> Int -> [Bool]
makeZebra _ 0 = []
makeZebra firstSta len = firstSta : (makeZebra (not firstSta) (len - 1))