import Control.Applicative

main :: IO ()
main = solve <$> getLine >>= print

solve :: String -> Int
solve ss = min (f (cycle "01")) (f (cycle "10"))
  where
    f xs = sum $ zipWith (\c1 c2 -> if c1 == c2 then 0 else 1) ss xs
