'use strict';
function main(input) {
  const arr = input.trim().split('\n');
  const a = Number(arr[0]);
  const b = arr[1].split(' ').map(x => Number(x));
  let sum = 0;

  for (let i = 0; i < b.length; i ++) {
    for (let j = 0; j < b.length; j ++) {
      if (i === j) {
        continue;
      }
      sum += b[i] * b[j];
    }
  }
  
  console.log(sum / 2);
}

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