let rec combos<'a> (lst: 'a list) k : 'a list list =
    let impl () =
        let head = [lst.Head]
        let subcombos = combos lst.Tail (k - 1)
        let ret = subcombos |> List.map (fun x -> head @ x)
        ret @ (combos lst.Tail k)
    if k = 0 then [[]]
    elif lst.IsEmpty then []
    else impl ()

stdin.ReadLine() |> ignore
let input = stdin.ReadLine().Split() |> Array.map int |> Array.toList
let c = combos input 2
let ans = c |> List.sumBy (fun xs -> xs.Head * xs.Tail.Head)

printfn "%d" ans