import Text.ParserCombinators.ReadP miin = string "mi" *> many (char '-') *> char 'n' parse = readP_to_S parseFull p str = (fst . last) $ parse p str main = do str <- getContents print $ length $ parseFull (many miin) str