open System

let N = Console.ReadLine() |> int
let D = Console.ReadLine().Split() |> Array.map int

let mutable sum = 0

for x in [ 0 .. N-1 ] do
    for y in [ x .. N-1 ] do
        sum <- sum + (if x<>y then D.[x] * D.[y] else 0)
        
printfn "%d" sum