object Main extends App {

  val n = scala.io.StdIn.readInt()
  val dArr = scala.io.StdIn.readLine().split(" ").map(_.toInt)


  def solve() =  {
    var sum = 0
    for(i <- 0 until n-1) {
      var j = i + 1
      while(j < n) {
        sum += dArr(i) * dArr(j)
        j += 1
      }
    }
    sum
  }

  println(solve)

}
