open System
let N = int (Console.ReadLine())
let d = Array.map int (Console.ReadLine().Split(' '))

let pairs = [for i in 0 .. N - 2 do
    for j in i + 1 .. N - 1 do
        yield d.[i] * d.[j]
]
Console.WriteLine(List.sum pairs)