func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let n=Int(readLine()!)!
let dd=readInts()
var count=0
for i in 0...n-2{
  for j in i+1...n-1{
    count+=dd[i]*dd[j]
  }
}
print(count)