Public Class Program
  Shared Sub Main()
    Dim n As Integer = Integer.Parse(Console.ReadLine())
    Dim d As Integer() = Array.ConvertAll(Of String, Integer)(Console.ReadLine().Split(" "), AddressOf Integer.Parse)
    Dim ans As Long = 0
    For i As Integer = 0 To n - 2
      Dim b As Integer = d(i)
      For j As Integer = i + 1 To n - 1
        ans += (b * d(j))
      Next
    Next
    Console.WriteLine(ans.ToString())
  End Sub
End Class