input = require('fs').readFileSync('/dev/stdin', 'utf8')
lines = input.split('\n')
N = lines.shift() * 1
line = lines.shift().split(' ')
for (i=0; i<N; i++) {
    line[i] = line[i] * 1
}
sum = 0
for (i=0; i<N; i++) {
    for (j=i+1; j<N; j++) {
        sum += line[i] * line[j]
    }
}
console.log(sum)