let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.map f

let n = read int
let ds = reads int

let mutable acc = 0
for i = 0 to n-2 do
    for j = (i+1) to n-1 do
        acc <- acc + (ds.[i] * ds.[j])
printfn "%d" acc    