import itertools
n = int(input())
d = list(map(int, input().split()))
lst = list(itertools.combinations(d, 2))

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

ans = 0
for i in lst:
    a = i[0] * i[1]
    ans += a
print(ans)
