import qualified Data.ByteString.Char8 as C
import Data.List

main = sol <$> C.getLine >>= print

sol s = fst . C.foldl' cnt (0, C.head s) $ C.tail s 

cnt (n,c) c'
  | c == c'   = (n, c')
  | otherwise = (n+1, c')