'use strict';
const main = input => {
  const n = parseInt(input[0]);
  const d = input[1].split(' ').map(val => parseInt(val));
  // console.log(n, d);
  let count = 0;
  for(let i=0; i<n-1; i++) {
    for(let j=i+1; j<n; j++) {
      count += d[i] * d[j];
    }
  }
  console.log(count);
  
}
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));