fun main (args : Array<String>) {
	val n = readLine()
	val l = readLine()!!.split(" ")
	var list : MutableList<Int> = mutableListOf()
	var result : Int = 0
	for (i in l) {
		list.add(i.toInt())
	}
	for (i in 0..list.size - 2) {
		for (j in i + 1..list.size - 1) {
			result += (list[i] * list[j])
		}
	}
	println("${result}")
}