import itertools

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

ans_lists = []
for v in itertools.combinations(tastes, 2):
    cure = v[0]*v[1]
    ans_lists.append(cure)

ans = 0
for i in ans_lists:
    ans += i
print(ans) import itertools itertools n = int(input()) n int(input()) int input() input tastes = list(map(int, input().split())) tastes list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans_lists = [] ans_lists [] for v in itertools.combinations(tastes, 2):
    cure = v[0]*v[1]
    ans_lists.append(cure) v itertools.combinations(tastes, 2) itertools.combinations itertools combinations tastes 2 cure = v[0]*v[1] cure v[0]*v[1] v[0] v 0 v[1] v 1 ans_lists.append(cure) ans_lists.append ans_lists append cure ans = 0 ans 0 for i in ans_lists:
    ans += i i ans_lists ans += i ans i print(ans) print ans tastes = list(map(int, input().split())) list(map(int, input().split())) tastes ans += i i ans ans_lists = [] [] ans_lists ans = 0 0 ans cure = v[0]*v[1] v[0]*v[1] cure n = int(input()) int(input()) n
import itertools

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

ans_lists = []
for v in itertools.combinations(tastes, 2):
    cure = v[0]*v[1]
    ans_lists.append(cure)

ans = 0
for i in ans_lists:
    ans += i
print(ans)