import Data.List main = print . (`div`4) . sum . map f . map length . group . sort . drop 1 . words =<< getContents where f a | odd a = a*2-1 | otherwise = a*2