import itertools
import math

n=int(input())
d=list(map(int,input().split()))

ans=0
for v in itertools.combinations(d, 2):
  x=v[0]*v[1]
  ans+=x

print(ans) import itertools itertools import math math n=int(input()) n int(input()) int input() input d=list(map(int,input().split())) d list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans=0 ans 0 for v in itertools.combinations(d, 2):
  x=v[0]*v[1]
  ans+=x v itertools.combinations(d, 2) itertools.combinations itertools combinations d 2 x=v[0]*v[1] x v[0]*v[1] v[0] v 0 v[1] v 1 ans+=x ans x print(ans) print ans n=int(input()) int(input()) n x=v[0]*v[1] v[0]*v[1] x ans=0 0 ans ans+=x x ans d=list(map(int,input().split())) list(map(int,input().split())) d
import itertools
import math

n=int(input())
d=list(map(int,input().split()))

ans=0
for v in itertools.combinations(d, 2):
  x=v[0]*v[1]
  ans+=x

print(ans)