import java.util.Scanner
import java.io.PrintWriter

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val pw = new PrintWriter(System.out)

    val n = sc.nextInt()
    val d = Seq.fill(n)(sc.nextInt())
    var sum = 0;
    for (i <- 0 until n) {
      for (j <- i + 1 until n) {
        sum += d(i) * d(j);
      }
    }
    pw.println(sum)

    pw.flush()
  }
}