import java.util.Scanner

val sc = Scanner(System.`in`)

fun main(args : Array<String>) {
    val n = sc.nextInt()
    val dd = listOfInt(n)

    var sum = 0
    for (i in 0 until n-1) {
        for (j in i+1 until n) {
            sum += dd[i] * dd[j]
        }
    }

    println(sum)
}

fun listOfInt(n: Int) = (1..n).map { sc.nextInt() }.toList()