import java.util.Scanner

object Main extends App{
  val sc = new Scanner(System.in)

  val n = sc.nextInt

  val dl = Seq.fill(n)(sc.nextInt)

  val sum = (
    for {
      x <- dl
      y <- dl
    } yield x * y
    ).sum

  val squreSum = dl.map(x => x * x).sum

  val res =  (sum - squreSum) / 2

  println(res)



}