import Control.Monad
import Data.List

func::Int->Int
func 1 = 0
func n = div (n * (n-1)) 2

main::IO ()
main = do
    n <- readLn
    xs <- replicateM n getLine
    print $ sum $ map func $ map length $ group $ sort $ map sort xs