from itertools import combinations as C

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

D = list(C(d, 2))

ans = 0

for i in D:
    ans += i[0] * i[1]

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

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

D = list(C(d, 2))

ans = 0

for i in D:
    ans += i[0] * i[1]

print(ans)