import Data.List -- sort
import Control.Monad -- replicateM

readInt = read <$> getLine :: IO Integer
arrayInt = map read . words <$> getLine :: IO [Integer]
writeln x = putStrLn $ unwords x :: IO ()

main = do
    ss <- map (\ c -> read [c]) <$> getLine
    print $ min (eval (cycle [0,1]) ss) (eval (cycle [1,0]) ss)

eval a b = sum $ zipWith (\ x y -> if x == y then 0 else 1) a b
