let n = stdin.ReadLine() |> int
let ds = stdin.ReadLine().Split() |> Array.map int

seq{
    for i in 0..n-1 do
        for j in i+1..n-1 -> (ds.[i], ds.[j])
}
|> Seq.sumBy (fun (x,y) -> x*y)
|> stdout.WriteLine