Imports System.Collections.Generic
Module D
    Sub Main(ByVal args() As String)
        Dim N As Integer = Integer.Parse(Console.ReadLine())
        Dim arr() As String = Split(Console.ReadLine())
        Dim A_i() As Integer = Array.ConvertAll(Of String, Integer)(arr, AddressOf Integer.Parse)
        Dim i, j As Integer
        Dim dic As New Dictionary(Of Integer, Integer)
        Dim result As Integer
        For i = 0 To N - 1
            dic.Clear()
            result = 0
            For j = 0 To N - 1
                If i <> j Then
                    If dic.ContainsKey(arr(j)) Then
                        dic(arr(j)) += 1
                    Else
                        dic.Add(arr(j), 1)
                    End If
                End If
            Next
            Dim wA_i(dic.Count - 1) As Integer
            dic.Values.CopyTo(wA_i, 0)
            Array.Sort(wA_i, StringComparer.Ordinal)
            Array.Reverse(wA_i)
            For j = 0 To dic.Count - 1
                If wA_i(j) > 1 Then
                    result += wA_i(j) * (wA_i(j) - 1) / 2
                Else
                    Exit For
                End If
            Next
            Console.WriteLine(result)
        Next
    End Sub
End Module