import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val N: Int = sc.nextInt()
  var d = mutableListOf<Int>()
  for (i in 1..N) {
    val di: Int = sc.nextInt()
    d.add(di)
  }
  var ans: Int = 0
  for (i in 0..N-2) {
    for (j in i+1..N-1) {
      ans += d[i]*d[j]
    }
  }
  println(ans)
  
}