import Control.Monad
import Data.List
main = do
    n <- getLine >>= return . (read :: String -> Int)
    s <- replicateM n getLine
    putStrLn . show . sum . map ((\x -> x * (x-1) `div` 2) . length) . group . sort $ map sort s