object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val d = List.fill(n)(sc.nextInt)

    var ans = 0
    (0 until n).foreach(i => ans += d.drop(i + 1).map(_ * d(i)).sum)
    println(ans)
  }
}