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

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

for i in d:
    count += 1
    for j in range(count, n):
        sum += i * d[j]
print(sum)