import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import qualified Data.Map.Strict as M

main :: IO [()]
main = abc159d

abc159d = do
    [n] <- getIntList
    a <- getIntList
    let dict = genDict M.empty a
    mapM (\x -> print $ sumComb dict - (M.!) dict x + 1) a

genDict :: (Integral a) => M.Map a a -> [a] -> M.Map a a
genDict m [] = m
genDict m (a:as) = if M.member a m
                   then genDict (M.update (\x -> Just (x+1)) a m) as
                   else genDict (M.insert a 1 m) as

sumComb :: M.Map Integer Integer -> Integer
sumComb dict = sum $ map comb $ M.elems dict

comb :: Integer -> Integer
comb k
    | k < 2 = 0
    | otherwise = div (k * (fromIntegral k - 1)) 2

readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words
getIntList = readIntList <$> BS.getLine