import Data.List main = getLine >>= print . head . (++[-1]) . sort . map length . filter (\s -> (not.null) s && head s == 'c' && length (filter (=='w') s) == 2) . concatMap tails . inits