from itertools import combinations

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

c=list(combinations(d,2))

ans=0

for i in range(len(c)):
    a=c[i][0]*c[i][1]
    ans+=a

print(ans) from itertools import combinations 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 c=list(combinations(d,2)) c list(combinations(d,2)) list combinations(d,2) combinations d 2 ans=0 ans 0 for i in range(len(c)):
    a=c[i][0]*c[i][1]
    ans+=a i range(len(c)) range len(c) len c a=c[i][0]*c[i][1] a c[i][0]*c[i][1] c[i][0] [i] c i 0 c[i][1] [i] c i 1 ans+=a ans a print(ans) print ans c=list(combinations(d,2)) list(combinations(d,2)) c ans=0 0 ans d=list(map(int,input().split())) list(map(int,input().split())) d a=c[i][0]*c[i][1] c[i][0]*c[i][1] a N=int(input()) int(input()) N ans+=a a ans
from itertools import combinations

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

c=list(combinations(d,2))

ans=0

for i in range(len(c)):
    a=c[i][0]*c[i][1]
    ans+=a

print(ans)
