function Main(input) {input=input.split("\n");var n=parseInt(input[0], 10);var d=[];d=input[1].split(" ").map(Number);tl=0;for(i=0;i<n;i++){for(j=i+1;j<n;j++){tl = tl+ d[i]*d[j];}}console.log(tl);}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));