object Main extends App {
  val n = readInt
  val input = readLine.split(" ").map(_.toInt)
  
  val all = for(i <- 0 until n - 1;
     j <- i + 1 until n) yield input(i) * input(j)

  println(all.reduceLeft(_ + _))  
}