fun calc143B(ds: List<Int>): Int {
    var ans = 0
    val indexed = ds.mapIndexed { i, j -> i to j }
    for ((i, d1) in indexed) {
        for ((j, d2) in indexed) {
            if (i == j) continue
            ans += d1 * d2
        }
    }
    return ans / 2
}

fun main(args: Array<String>) {
    val N = readLine()!!
    val ds = readLine()!!.split(" ").map { it.toInt() }
    println(calc143B(ds))
}
