n = int(input())
d = [int(s) for s in input().split()]
ans = 0
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        else:
            ans += d[i] * d[j]
print(ans // 2) n = int(input()) n int(input()) int input() input int(s) for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() int(s) int s d = [int(s) for s in input().split()] d [int(s) for s in input().split()] ans = 0 ans 0 for i in range(n):
    for j in range(n):
        if i == j:
            continue
        else:
            ans += d[i] * d[j] i range(n) range n for j in range(n):
        if i == j:
            continue
        else:
            ans += d[i] * d[j] j range(n) range n if i == j:
            continue
        else:
            ans += d[i] * d[j] i == j i j continue ans += d[i] * d[j] ans d[i] * d[j] d[i] d i d[j] d j print(ans // 2) print ans // 2 ans 2 ans += d[i] * d[j] d[i] * d[j] ans ans = 0 0 ans n = int(input()) int(input()) n d = [int(s) for s in input().split()] [int(s) for s in input().split()] d
n = int(input())
d = [int(s) for s in input().split()]
ans = 0
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        else:
            ans += d[i] * d[j]
print(ans // 2)