num=int(input())
D=list(map(int,input().split()))
val=0
for i in range (0,len(D)):
  for j in range (i+1,len(D)):
    val+=D[i]*D[j]
print(val) num=int(input()) num 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 val=0 val 0 for i in range (0,len(D)):
  for j in range (i+1,len(D)):
    val+=D[i]*D[j] i range (0,len(D)) range 0 len(D) len D for j in range (i+1,len(D)):
    val+=D[i]*D[j] j range (i+1,len(D)) range i+1 i 1 len(D) len D val+=D[i]*D[j] val D[i]*D[j] D[i] D i D[j] D j print(val) print val val+=D[i]*D[j] D[i]*D[j] val D=list(map(int,input().split())) list(map(int,input().split())) D val=0 0 val num=int(input()) int(input()) num
num=int(input())
D=list(map(int,input().split()))
val=0
for i in range (0,len(D)):
  for j in range (i+1,len(D)):
    val+=D[i]*D[j]
print(val)