import std.algorithm;
import std.bigint;
import std.bitmanip;
import std.concurrency;
import std.container;
import std.conv;
import std.functional;
import std.format;
import std.math;
import std.meta;
import std.numeric;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.traits;
import std.typecons;


auto solve(long N, long[] d) {
    long sum;
    foreach (i; 0 .. N) foreach (j; i + 1 .. N) {
        sum += d[i] * d[j];
    }
    return sum;
}


void main() {
    auto input = stdin.byLine.map!split.joiner;

    long N;
    N = input.front.to!long;
    input.popFront;

    long[] d = new long[](cast(size_t) (N));
    foreach (i; 0 .. cast(size_t) (N)) {
        d[i] = input.front.to!long;
        input.popFront;
    }

    static if (is(ReturnType!solve == void))
        solve(N, d);
    else
        solve(N, d).writeln;
}
