#include <bits/stdc++.h>
using namespace std;
const int MAXN=60;
int n,ans,a[MAXN];
int main () {
	scanf("%d",&n);
	for (int i=1;i<=n;i++) {
		scanf("%d",&a[i]);
		for (int j=1;j<i;j++) {
			ans+=a[j]*a[i];
		}
	}
	printf("%d\n",ans);
}