fun main (args:Array<String>){
    val numOfTakoyaki = readLine()!!.toInt()
    val goodTaste = readLine()!!.split(" ").map(String::toInt)
    var recovery = 0
    var counter = 1
    for(i in 0..numOfTakoyaki-2){
        for(j in counter..numOfTakoyaki-1){
            recovery += goodTaste[i] * goodTaste[j]
        }
        counter++
    }
    println(recovery)
}