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