n = int(input())
d = list(map(int, input().split()))

recover = 0

for i in range(n):
    for j in range(n):
        if i==j:
            pass
        else:
            recover += d[i]*d[j]

print(int(recover/2)) 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 recover = 0 recover 0 for i in range(n):
    for j in range(n):
        if i==j:
            pass
        else:
            recover += d[i]*d[j] i range(n) range n for j in range(n):
        if i==j:
            pass
        else:
            recover += d[i]*d[j] j range(n) range n if i==j:
            pass
        else:
            recover += d[i]*d[j] i==j i j recover += d[i]*d[j] recover d[i]*d[j] d[i] d i d[j] d j print(int(recover/2)) print int(recover/2) int recover/2 recover 2 recover = 0 0 recover d = list(map(int, input().split())) list(map(int, input().split())) d recover += d[i]*d[j] d[i]*d[j] recover n = int(input()) int(input()) n
n = int(input())
d = list(map(int, input().split()))

recover = 0

for i in range(n):
    for j in range(n):
        if i==j:
            pass
        else:
            recover += d[i]*d[j]

print(int(recover/2))