n,s,t,A=int(input()),0,0,list(map(int,input().split())) for a in A:s+=a*a;t+=a print((t*t-s)//2)