N = int(input())
d_lst= [int(x) for x in input().split(' ')]
sum = 0
for i in range(len(d_lst)):
    for j in range(1+i,len(d_lst)):
        sum = sum + d_lst[i]*d_lst[j]
print(sum) N = int(input()) N int(input()) int input() input int(x) for x in input().split(' ') for x in input().split(' ') x input().split(' ') ().split () input split ' ' for x in input().split(' ') int(x) int x d_lst= [int(x) for x in input().split(' ')] d_lst [int(x) for x in input().split(' ')] sum = 0 sum 0 for i in range(len(d_lst)):
    for j in range(1+i,len(d_lst)):
        sum = sum + d_lst[i]*d_lst[j] i range(len(d_lst)) range len(d_lst) len d_lst for j in range(1+i,len(d_lst)):
        sum = sum + d_lst[i]*d_lst[j] j range(1+i,len(d_lst)) range 1+i 1 i len(d_lst) len d_lst sum = sum + d_lst[i]*d_lst[j] sum sum + d_lst[i]*d_lst[j] sum d_lst[i]*d_lst[j] d_lst[i] d_lst i d_lst[j] d_lst j print(sum) print sum sum = 0 0 sum d_lst= [int(x) for x in input().split(' ')] [int(x) for x in input().split(' ')] d_lst N = int(input()) int(input()) N sum = sum + d_lst[i]*d_lst[j] sum + d_lst[i]*d_lst[j] sum
N = int(input())
d_lst= [int(x) for x in input().split(' ')]
sum = 0
for i in range(len(d_lst)):
    for j in range(1+i,len(d_lst)):
        sum = sum + d_lst[i]*d_lst[j]
print(sum)