#include<stdio.h>
int main()
{
	int N;
	int sum=0;
	scanf("%d",&N);
	int number[N];
	int i,j;

	for(i=0;i<N;i++){
			scanf("%d",&number[i]);

	}
	int x;
	for(i=0;i<N;i++){
		for(x=i+1;x<N;x++){
			sum=sum+number[i]*number[x];
		}
	}
	printf("%d",sum);
	return 0;
 }
