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