import itertools

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

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

ans = 0
for a, b in list(itertools.combinations(range(N), 2)):
    ans += d[a] * d[b]

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

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

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

ans = 0
for a, b in list(itertools.combinations(range(N), 2)):
    ans += d[a] * d[b]

print(ans)
