import itertools

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

l1 = [x for x in range(n)]
l2 = [x for x in range(n)]

ans = 0
sub = 0

for v1, v2 in itertools.product(l1, l2):
    ans += D[v1] * D[v2]

for i in range(n):
    sub += D[i]*D[i]

print((ans-sub)//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 x for x in range(n) for x in range(n) x range(n) range n for x in range(n) x l1 = [x for x in range(n)] l1 [x for x in range(n)] x for x in range(n) for x in range(n) x range(n) range n for x in range(n) x l2 = [x for x in range(n)] l2 [x for x in range(n)] ans = 0 ans 0 sub = 0 sub 0 for v1, v2 in itertools.product(l1, l2):
    ans += D[v1] * D[v2] v1 v2 itertools.product(l1, l2) itertools.product itertools product l1 l2 ans += D[v1] * D[v2] ans D[v1] * D[v2] D[v1] D v1 D[v2] D v2 for i in range(n):
    sub += D[i]*D[i] i range(n) range n sub += D[i]*D[i] sub D[i]*D[i] D[i] D i D[i] D i print((ans-sub)//2) print (ans-sub)//2 ans-sub ans sub 2 D = list(map(int, input().split())) list(map(int, input().split())) D ans += D[v1] * D[v2] D[v1] * D[v2] ans l2 = [x for x in range(n)] [x for x in range(n)] l2 l1 = [x for x in range(n)] [x for x in range(n)] l1 ans = 0 0 ans sub = 0 0 sub n = int(input()) int(input()) n sub += D[i]*D[i] D[i]*D[i] sub
import itertools

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

l1 = [x for x in range(n)]
l2 = [x for x in range(n)]

ans = 0
sub = 0

for v1, v2 in itertools.product(l1, l2):
    ans += D[v1] * D[v2]

for i in range(n):
    sub += D[i]*D[i]

print((ans-sub)//2)