import itertools
n=int(input())
l=list(map(int,input().split()))
c=itertools.combinations(l,2)
ans=sum(x*y for x,y in c)
print(ans) import itertools itertools n=int(input()) n int(input()) int input() input l=list(map(int,input().split())) l list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split c=itertools.combinations(l,2) c itertools.combinations(l,2) itertools.combinations itertools combinations l 2 ans=sum(x*y for x,y in c) ans sum(x*y for x,y in c) sum x*y x y print(ans) print ans c=itertools.combinations(l,2) itertools.combinations(l,2) c n=int(input()) int(input()) n l=list(map(int,input().split())) list(map(int,input().split())) l ans=sum(x*y for x,y in c) sum(x*y for x,y in c) ans
import itertools
n=int(input())
l=list(map(int,input().split()))
c=itertools.combinations(l,2)
ans=sum(x*y for x,y in c)
print(ans)