N = int(input())
D = list(map(int, input().split()))
from itertools import combinations
ans = 0
for i , j in combinations(D,2):
    ans += i*j
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 from itertools import combinations ans = 0 ans 0 for i , j in combinations(D,2):
    ans += i*j i j combinations(D,2) combinations D 2 ans += i*j ans i*j i j print(ans) print ans N = int(input()) int(input()) N ans = 0 0 ans ans += i*j i*j ans D = list(map(int, input().split())) list(map(int, input().split())) D
N = int(input())
D = list(map(int, input().split()))
from itertools import combinations
ans = 0
for i , j in combinations(D,2):
    ans += i*j
print(ans)