import Control.Applicative
import Control.Monad
import Data.List

main :: IO ()
main = do
    ss <- getLine
    let f (n, oc) nc
            | oc == nc  = (n, oc)
            | otherwise = (n + 1, nc)
    let ans = foldl' f (0, head ss) ss
    print (fst ans)