'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const N = parseInt(args[0][0], 10)
	const d = args[1].map(arg => parseInt(arg, 10))
	let ans = 0

	for (let i = 0; i < N; i++) {
		for (let j = i; j < N; j++) {
			if (i === j) continue
			ans += d[i] * d[j]
		}
	}

	console.log(ans)
}

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