#include <iostream>

using namespace std;
int a[100],sum = 0;
int main(){
	int i,j,n;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> a[i];
	}
	for(i=0;i<n;i++){
		for(j=i + 1;j<n;j++){
			sum += a[i]*a[j];
		}
	}
	cout << sum << endl;
}