import qualified Data.ByteString.Char8 as C
 
main = do
  a <- C.getLine
  print $ solve a
 
solve a
  | C.length a == 1 = 1
  | otherwise = solve xs + C.foldr f 0 xs
    where
      x = C.head a
      xs = C.tail a
      f c n = if x == c then n else succ n