import java.util.*

fun main(args : Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    var sum = 0
    val array = IntArray(n)
    for (k in 0..n-1) {
        array[k] = scanner.nextInt()
    }

    for (i in 0..n-1) {
        val di = array[i]
        for (j in i+1..n-1) {
            val dj = array[j]
            val mul = di * dj
            sum += mul
        }
    }
    println(sum)
}