solve :: String -> Int
solve ""  = 0
solve [a] = 0
solve str
    | x == y   = solve nx
    | x /=y    = solve nx + 1
    where x = head str
          y = last str
          nx = tail $ init str

main = do
    line <- getLine
    print $ solve line