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

recovery = 0
for i in range(n):
    sum_mul -= d[i]
    recovery += d[i] * sum_mul

print(recovery) 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 sum_mul = sum(d) sum_mul sum(d) sum d recovery = 0 recovery 0 for i in range(n):
    sum_mul -= d[i]
    recovery += d[i] * sum_mul i range(n) range n sum_mul -= d[i] sum_mul d[i] d i recovery += d[i] * sum_mul recovery d[i] * sum_mul d[i] d i sum_mul print(recovery) print recovery sum_mul -= d[i] d[i] sum_mul sum_mul = sum(d) sum(d) sum_mul recovery += d[i] * sum_mul d[i] * sum_mul recovery d = list(map(int, input().split())) list(map(int, input().split())) d recovery = 0 0 recovery n = int(input()) int(input()) n
n = int(input())
d = list(map(int, input().split()))
sum_mul = sum(d)

recovery = 0
for i in range(n):
    sum_mul -= d[i]
    recovery += d[i] * sum_mul

print(recovery)
