Module Module1

    Sub Main()

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

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

        Console.WriteLine(ans)
        Console.Read()

    End Sub

End Module
