function main(arg) {
    var arg2 = arg.split(/\n/g);
    var kosuu = parseInt(arg2[0]);
    var yum_array = arg2[1].split(/\s+/g);
    var kaifuku = 0;
    for(i=0;i<kosuu;i++){
    	for(j=i+1;j<kosuu;j++){
    		kaifuku += parseInt(yum_array[i])*parseInt(yum_array[j]);
    	}
    }
    console.log(kaifuku);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));