import itertools

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

print(sum([i * j for i, j in list(itertools.combinations(d, 2))])) 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 i * j for i, j in list(itertools.combinations(d, 2)) for i, j in list(itertools.combinations(d, 2)) i j list(itertools.combinations(d, 2)) list itertools.combinations(d, 2) itertools.combinations itertools combinations d 2 for i, j in list(itertools.combinations(d, 2)) i * j i j print(sum([i * j for i, j in list(itertools.combinations(d, 2))])) print sum([i * j for i, j in list(itertools.combinations(d, 2))]) sum [i * j for i, j in list(itertools.combinations(d, 2))] N = int(input()) int(input()) N d = list(map(int, input().split())) list(map(int, input().split())) d
import itertools

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

print(sum([i * j for i, j in list(itertools.combinations(d, 2))]))