import Control.Monad
import Data.Maybe (fromJust)
import Data.List as List

solve :: String -> Int
solve [] = 0
solve (x:[]) = 0
solve (x1:x2:xs)
    | x1 /= x2 = 1 + (solve (x2:xs))
    | otherwise = (solve (x2:xs))

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