'use strict';

const testcase = null;

function main(input) {
    const n = parseInt(input.shift());
    var total = 0;
    var ds = [];
    for (var i = 0; i < n; i++) {
        const d = parseInt(input.shift());
        for (var v of ds) {
            total += d * v;
        }
        ds.push(d);
    }
    console.log(total);
}

if (process.argv[1] == __filename) {
    const input = testcase
        || require('fs')
            .readFileSync('/dev/stdin', 'utf-8');
    main(input.split(/\s/));
}
