#include<string>
#include<stdio.h>
#include<iostream>
using namespace std;
int n, m;
int a[105];
int sum;
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < n; i++){
		for(int j=i+1;j<n;j++)
		sum += a[i] * a[j];
	};
	cout <<sum << endl;
	return 0;
}
