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

conbination = int((n * (n-1)) / 2)
ans = 0

for i in range(n-1):
    for j in range(i+1,n):
        ans += d[i] * d[j]

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

conbination = int((n * (n-1)) / 2)
ans = 0

for i in range(n-1):
    for j in range(i+1,n):
        ans += d[i] * d[j]

print(ans)