#include<cstdio>
int main()
{
	int n,d[100],i,j,sum;
	scanf("%d",&n);
	for(i=0;i<n;i++)	scanf("%d",&d[i]);
	sum=0;
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			sum+=d[i]*d[j];
		}
	}
	printf("%d\n",sum);
	return 0;
}
