import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let nk=readInts()
let n=nk[0]
let d=readInts()
var ans=0

for i in 0..<n-1{
  for j in i+1..<n{ans+=d[i]*d[j]}
}

print(ans)