object Main extends App {
  import scala.io.StdIn._
  val n = readInt()
  val d = readLine().split(" ").map(_.toInt)
  val res = for (i <- 0 to n-1; j <- i+1 to n-1) yield d(i) * d(j)
  println(res.sum)
}