N = int(input())
alist = list(map(int, input().split()))
gokei = 0
for i in range(0,N):
    for j in range(i+1,N):
        kaihuku = alist[i]*alist[j]
        gokei += kaihuku
print(gokei) N = int(input()) N int(input()) int input() input alist = list(map(int, input().split())) alist list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split gokei = 0 gokei 0 for i in range(0,N):
    for j in range(i+1,N):
        kaihuku = alist[i]*alist[j]
        gokei += kaihuku i range(0,N) range 0 N for j in range(i+1,N):
        kaihuku = alist[i]*alist[j]
        gokei += kaihuku j range(i+1,N) range i+1 i 1 N kaihuku = alist[i]*alist[j] kaihuku alist[i]*alist[j] alist[i] alist i alist[j] alist j gokei += kaihuku gokei kaihuku print(gokei) print gokei gokei += kaihuku kaihuku gokei alist = list(map(int, input().split())) list(map(int, input().split())) alist gokei = 0 0 gokei kaihuku = alist[i]*alist[j] alist[i]*alist[j] kaihuku N = int(input()) int(input()) N
N = int(input())
alist = list(map(int, input().split()))
gokei = 0
for i in range(0,N):
    for j in range(i+1,N):
        kaihuku = alist[i]*alist[j]
        gokei += kaihuku
print(gokei)