
const main = arg => {

    const input = arg.trim().split("\n");
    const n = parseInt(input[0]);
    ds = input[1].trim().split(" ").map(e => parseInt(e));

    let sum = 0;
    for (let i = 0; i < n; i++) {
        for (let j = i + 1; j < n; j++) {
            sum += ds[i] * ds[j];
        }
    }
    console.log(sum);

}

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