import Data.List
import Control.Monad

main = do
  n <- readLn
  ss <- replicateM n getLine
  print $ solve ss

solve ss = sum $ map f $ group $ sort $ map sort ss where
  f s = fromIntegral $ length s * (length s - 1) `div` 2