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

import itertools

ans = 0
pairs = list(itertools.combinations(d, 2))

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

import itertools

ans = 0
pairs = list(itertools.combinations(d, 2))

for pair in pairs:
    ans += pair[0] * pair[1]
    
print(ans)