main :: IO ()
main = do
  strs <- getLine
  print $ solve strs

solve :: String -> Int
solve [] = 0
solve (s:ss) = go ss s
  where
    go :: String -> Char -> Int 
    go (x:xs) state
      | x == state = 0 + go xs x
      | otherwise = 1 + go xs x
    go [] _ = 0
