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)
        s1 = fst $ splitAt ((length sx `div` 2) + 1) sx
    print . length . nub $ [(min i j, max i j) | (i,si) <- s1, (j,sj) <- sx, i /= j && si == sj]
