object Main extends App {
    val n = io.StdIn.readLine.toInt
    val d = io.StdIn.readLine.split(' ').map(_.toInt)

    val ans = for(i <- 0 until n - 1; j <- i + 1 until n) yield {
        if(i != j) d(i) * d(j) else 0
    }

    println(ans.sum)
}