open System
open System.Linq;


let N=stdin.ReadLine()|>int
let d=stdin.ReadLine().Split()|>Array.map int

[<EntryPoint>]
let sf argv =
    let mutable ans=0
    for i in [0..N-2] do
        for j in [i+1..N-1] do
            ans <- ans + d.[i]*d.[j]
    printfn "%d" ans
    0 