import qualified Data.ByteString.Char8 as C solve :: C.ByteString -> Int solve ss = min nw (nc - 1) where nc = C.count 'c' ss nw = C.count 'w' ss main :: IO () main = do ss <- C.getLine print $ solve ss