"use strict";

function Main(input) {
  input = input.split("\n")
  let N = input[0];
  let d = input[1].split(" ");
  let result = 0;

  d.forEach((num) => {
    d = d.slice(1)

    d.forEach((num2) => {
      result += num * num2;
    })
  });


  console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));