N = int(input())
d = list(map(int, input().split()))
s = 0

for i in range(N):
    for j in range(i+1, N):
        s += d[i] * d[j]

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

for i in range(N):
    for j in range(i+1, N):
        s += d[i] * d[j]

print(s)