import           Control.Monad
import           Data.List

main = do
    n <- readLn :: IO Int
    s <- replicateM n getLine :: IO [String]
    let sx = zip [1..] (map sort s)
    print . (`div`2) $ length [(si,sj) | (i,si) <- sx, (j,sj) <- sx, i /= j && si == sj]
