import Text.Printf

checkTiles :: Int -> Bool -> [Char] -> Int
checkTiles flip _ "" = flip
checkTiles flip True ('0' : rest) = checkTiles flip False rest
checkTiles flip False ('1' : rest) = checkTiles flip True rest
checkTiles flip True ('1' : rest) = checkTiles (flip + 1) False rest
checkTiles flip False ('0' : rest) = checkTiles (flip + 1) True rest

main = do
  (first:rest) <- getLine
  let fs = case first of
             '0' -> False
             '1' -> True
  let flipTiles = checkTiles 0 fs rest
  printf "%d\n" flipTiles