import qualified Data.ByteString.Char8 as B

solve s = min a b
    where
        a = length $ filter (not . id) $ B.zipWith (==) s t
        b = length $ filter (not . id) $ B.zipWith (==) s u
        t = B.pack $ take (B.length s) (cycle ['0','1'])
        u = B.pack $ take (B.length s) (cycle ['1','0'])

main = do
    s <- B.getLine
    print $ solve s