import Control.Monad
import Data.List

solve s = (l * (l - 1)) `div` 2
            where
                l = length s

main = do
    n <- readLn :: IO Int
    sn <- replicateM n (sort <$> getLine)
    print $ sum $ map solve $ group $ sort sn