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

void main() {
    int n;
    readf("%d\n", &n);
    auto ds = readln().split.map!(to!int);

    auto sum = 0;
    foreach (i; 0 .. n) {
        foreach (j; i + 1 .. n) {
            sum += ds[i] * ds[j];
        }
    }
    writeln(sum);
}
