import scala.io.StdIn._
object Main extends App {
  val n = readInt
  val d = readLine.split(" ").map(_.toInt)
  println((0 until n)
    .combinations(2)
    .foldLeft(0)((acc, t) => {
      acc + (d(t(0)) * d(t(1)))
    }))
}
