import std.conv, std.stdio, std.algorithm, std.string, std.range, std.math;

void main() {
  readln;
  const tako = readln.split.map!(to!int).array;
  const N    = tako.length;
    
  int z;
  foreach (x; 0..N) foreach (y; x+1..N) {
    z += tako[x]*tako[y];
  }
  z.writeln;
}