main :: IO ()
main = do
    s <- getLine
    print (min (f True s) (f True (map rev s)))

inputs :: Read a => IO [a]
inputs = map read . words <$> getLine

f :: Bool -> String -> Int
f _ [] = 0
f True ('1':cs) = f False cs
f False ('0':cs) = f True cs
f b (_:cs) = 1 + f (not b) cs

rev :: Char -> Char
rev '1' = '0'
rev '0' = '1'
