import itertools
n = int(input())

a = list(map(int, input().split()))

pattern = itertools.combinations(a,2)
total = 0
for i,j in pattern:
    total += i*j
print(total) import itertools itertools n = int(input()) n int(input()) int input() input a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split pattern = itertools.combinations(a,2) pattern itertools.combinations(a,2) itertools.combinations itertools combinations a 2 total = 0 total 0 for i,j in pattern:
    total += i*j i j pattern total += i*j total i*j i j print(total) print total total = 0 0 total pattern = itertools.combinations(a,2) itertools.combinations(a,2) pattern a = list(map(int, input().split())) list(map(int, input().split())) a n = int(input()) int(input()) n total += i*j i*j total
import itertools
n = int(input())

a = list(map(int, input().split()))

pattern = itertools.combinations(a,2)
total = 0
for i,j in pattern:
    total += i*j
print(total)