
Imports System.Console
Module Module1
    Dim ans As Integer
    Dim n, k As Integer
    Sub Main()
        n = ReadLine()
        Dim s() As String = ReadLine().Split
        Dim l(n) As Integer
        For i = 1 To n
            l(i) = s(i - 1)
        Next
        Dim ii, iii As Integer
        For i = 1 To n
            For ii = i To n
                For iii = ii To n
                    If l(i) <> l(ii) And l(i) <> l(iii) And l(ii) <> l(iii) Then
                        Dim a As Integer = l(i)
                        Dim b As Integer = l(ii)
                        Dim c As Integer = l(iii)
                        If a + b > c Then
                            If b + c > a Then
                                If c + a > b Then
                                    ans += 1
                                End If
                            End If
                        End If
                    End If
                Next
            Next
        Next
        WriteLine(ans)
    End Sub
End Module
