import Control.Applicative
import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)
import Text.Printf
import Debug.Trace

getInts :: IO [Int]
getInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine

main = do
  s <- B.getLine
  print $ snd $ B.foldl (\(c,a) x -> (x,a + (if c /= x then 1 else 0))) (B.head s,0) s
