import itertools
N=int(input())
d=list(map(int,input().split()))
ls=[]
for i in range(N):
    ls.append(i)
lsp=list(itertools.permutations(ls,2))
#print(lsp)
ans=0
#print(lsp[])
for i in range(len(lsp)):
    ans += d[lsp[i][0]]*d[lsp[i][1]]
print(ans//2) import itertools itertools 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 ls=[] ls [] for i in range(N):
    ls.append(i) i range(N) range N ls.append(i) ls.append ls append i lsp=list(itertools.permutations(ls,2)) lsp list(itertools.permutations(ls,2)) list itertools.permutations(ls,2) itertools.permutations itertools permutations ls 2 ans=0 ans 0 for i in range(len(lsp)):
    ans += d[lsp[i][0]]*d[lsp[i][1]] i range(len(lsp)) range len(lsp) len lsp ans += d[lsp[i][0]]*d[lsp[i][1]] ans d[lsp[i][0]]*d[lsp[i][1]] d[lsp[i][0]] d lsp[i][0] [i] lsp i 0 d[lsp[i][1]] d lsp[i][1] [i] lsp i 1 print(ans//2) print ans//2 ans 2 lsp=list(itertools.permutations(ls,2)) list(itertools.permutations(ls,2)) lsp ls=[] [] ls ans += d[lsp[i][0]]*d[lsp[i][1]] d[lsp[i][0]]*d[lsp[i][1]] ans ans=0 0 ans N=int(input()) int(input()) N d=list(map(int,input().split())) list(map(int,input().split())) d
import itertools
N=int(input())
d=list(map(int,input().split()))
ls=[]
for i in range(N):
    ls.append(i)
lsp=list(itertools.permutations(ls,2))
#print(lsp)
ans=0
#print(lsp[])
for i in range(len(lsp)):
    ans += d[lsp[i][0]]*d[lsp[i][1]]
print(ans//2)
