Module Module1

    Sub Main()

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

        For i = 0 To N - 1
            For j = i + 1 To N - 1
                d(i) = CInt(tmp(i))
                wk += d(i) * CInt(tmp(j))
            Next
        Next

        Console.WriteLine(wk)
        'Console.Read()

    End Sub

End Module
