object Main extends App {
    val lines = io.Source.fromInputStream(System.in).getLines()
    val N = lines.next().toInt
    val As: Seq[Int] = lines.next().split(" ").map(_.toInt).toSeq

    // Count by each kind of A_i
    val map: Map[Int, Int] = As.groupBy(identity).mapValues(_.size)
    for (i <- 0 until N) {
        val reserved = As(i)
        val map1: Map[Int, Int] = map + (reserved -> (map(reserved) - 1))
        val ans = map1.values.map(n => n * (n - 1) / 2).sum
        println(ans)
    }
}
