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