object Main extends App {
    val garbage = scala.io.StdIn.readLine
    val points = scala.io.StdIn.readLine.split(" ").map(_.toInt).toSeq
    val answer = points.combinations(2).map(_.product).sum

    println(answer)
}