import std.stdio;
import std.string;
import std.conv;

void main() {
	int n;
	scanf("%d\n", &n);
	auto ds = readln.chomp.split.to!(long[]);
	long total = 0;
	foreach(i; 0..ds.length) {
		foreach(j; i+1..ds.length) {
			total += ds[i] * ds[j];
		}
	}
	total.write;
}
