import std.stdio, std.string, std.array, std.conv;

void main() {
    int n = readln.chomp.to!int;
    int[] d = readln.chomp.split.to!(int[]);
    int sum = 0;
    foreach (i; 0 .. n-1) {
        foreach (j; i+1 .. n) {
            sum += d[i] * d[j];
        }
    }
    sum.writeln;
}