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