import std.stdio, std.conv, std.string, std.range, std.algorithm, std.array,
  std.functional, std.container, std.typecons;

void main() {
  int N = readln.chomp.to!int;
  int[] d = readln.split.to!(int[]);

  int ans = 0;
  foreach(i; 0..N) {
    foreach(j; (1+i)..N) {
      ans += d[i] * d[j];
    }
  }
  ans.writeln;
}
