function Main(input) {
  input = input.split("\n");
  var  N = input[0];
  var D = input[1].split(" ").map(Number);
  var sum  = function(arr) {
      var sum = 0;
      for (var i=0,len=arr.length; i<len; ++i) {
          sum += arr[i];
      };
      return sum;
  };
var Dsum = sum(D);
var ans = 0;
for(var i= 0;i<N;i++){
  ans = ans + (D[i]*(Dsum-D[i]));
}
console.log(ans/2);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));