
import System.IO
import Control.Applicative ((<$>))

main = do
 s <- getLine
 putStrLn $ show $ cranke s 0

cranke :: [Char] -> Int -> Int
cranke [x] n = n
cranke (a:b:xs) n | a == b = cranke (b:xs) n
                  | otherwise = cranke (b:xs) (n+1)