import Control.Monad
import Data.List
main=do
 n<-readLn;s<-replicateM n (sort<$>getLine)
 (print.sum.(map (\x->quot(x*(x-1))2)))(f n (sort s) 1)
  where f 1 _ i =[i]
        f n s i =if(s!!0==s!!1)then(f(n-1)(tail s)(i+1))else(i:(f(n-1)(tail s)1))