import Data.List main = do s <- getLine let fs = map (\f -> sum [1..f-1]) . scanr (+) 0 . map (\c -> if c=='w' then 1 else 0) $ s print . sum . map snd . filter ((=='c') . fst) $ zip s fs