import Control.Monad
import Text.Printf
import Data.List

getInts :: IO [Int]
getInts = map read . words <$> getLine

main :: IO()
main = do
  [n] <- getInts
  sn <- replicateM n $ getLine
  printf "%d" $ slv sn

slv :: [String] -> Integer
slv sn = sum $ map (\x -> (x*(x-1)) `div` 2 ) $ map (fromIntegral.length) $ group $ sort $ map sort sn
