main = do
  s <- getLine 
  print $ (length $ dist s "") - 1

dist :: String ->  String -> [String]
dist [] ys = [ys]
dist (x:xs) [] = dist xs [x]
dist (x:xs) (y:ys)
  | x == y = dist xs (x:y:ys)
  | otherwise = (y:ys) : dist xs [x]