#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;

  int X = 0, Y = 0;
  for (int i = 0; i < N; i++) {
    int d;
    cin >> d;
    X += d;
    Y += d * d;
  }

  cout << (X * X - Y) / 2 << endl;
}