import scala.collection.mutable
import scala.io.StdIn
import java.util._
import util.control.Breaks._

object Main extends App {
  StdIn.readLine()
  val l = StdIn.readLine().split(" ").map(_.toInt)
  var sum = 0
  for(x <- l.indices){
    for(y <- x+1 until l.length){
      sum += l(x)*l(y)
    }
  }
  println(sum)
}
