# 問題：https://atcoder.jp/contests/abc143/tasks/abc143_b

n = int(input())
d = list(map(int, input().strip().split()))
res = 0
for i in range(1, n):
    for j in range(i):
        res += d[i] * d[j]
print(res) n = int(input()) n int(input()) int input() input d = list(map(int, input().strip().split())) d list(map(int, input().strip().split())) list map(int, input().strip().split()) map int input().strip().split() ().strip().split ().strip() ().strip () input strip split res = 0 res 0 for i in range(1, n):
    for j in range(i):
        res += d[i] * d[j] i range(1, n) range 1 n for j in range(i):
        res += d[i] * d[j] j range(i) range i res += d[i] * d[j] res d[i] * d[j] d[i] d i d[j] d j print(res) print res d = list(map(int, input().strip().split())) list(map(int, input().strip().split())) d res += d[i] * d[j] d[i] * d[j] res res = 0 0 res n = int(input()) int(input()) n
# 問題：https://atcoder.jp/contests/abc143/tasks/abc143_b

n = int(input())
d = list(map(int, input().strip().split()))
res = 0
for i in range(1, n):
    for j in range(i):
        res += d[i] * d[j]
print(res)
