import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val A = List.fill(N)(sc.nextInt)

  for (i <- 0 until N) {
    val x = A.groupBy(identity).map(x => {
      val a = x._2.size - (if (x._1 == A(i)) 1 else 0)
      a * (a - 1) / 2
    }).sum
    println(x)
  }
}
