function Main(input) {
    var N = parseInt(input[0], 10);
    var D = input.slice(1).map(n => parseInt(n));

    var result = 0;

    for (var i = 0; i < N; i++) {
        for (var j = i + 1; j < N; j++) {
            result += D[i] * D[j];
        }
    }

    console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));