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

from itertools import combinations
counter = 0
for i in combinations(range(N),2):
    a,b = i
    counter += D[a]*D[b]
    

print(counter) 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 counter = 0 counter 0 for i in combinations(range(N),2):
    a,b = i
    counter += D[a]*D[b]
     i combinations(range(N),2) combinations range(N) range N 2 a,b = i a i b counter += D[a]*D[b] counter D[a]*D[b] D[a] D a D[b] D b print(counter) print counter a,b = i i a counter += D[a]*D[b] D[a]*D[b] counter b = i i b D = list(map(int,input().split())) list(map(int,input().split())) D N = int(input()) int(input()) N counter = 0 0 counter
N = int(input())
D = list(map(int,input().split()))

from itertools import combinations
counter = 0
for i in combinations(range(N),2):
    a,b = i
    counter += D[a]*D[b]
    

print(counter)