Module Module1

    Sub Main()

        Dim N As Integer = Console.ReadLine()
        Dim tmp As String() = Split(Console.ReadLine())
        Dim i, j, k As Integer
        Dim ans As Integer = 0

        For i = 0 To N - 1
            For j = i + 1 To N - 1
                If CInt(i) < CInt(j) Then
                    For k = j + 1 To N - 1
                        If CInt(i) < CInt(k) And CInt(j) < CInt(k) Then
                            If CInt(tmp(i)) < CInt(tmp(j)) + CInt(tmp(k)) And CInt(tmp(j)) < CInt(tmp(i)) + CInt(tmp(k)) And CInt(tmp(k)) < CInt(tmp(i)) + CInt(tmp(j)) Then
                                ans += 1
                            End If
                        End If
                    Next
                End If
            Next
        Next

        Console.WriteLine(ans)
        'Console.Read()

    End Sub

End Module
