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