n = int(input())
q = list(map(int,input().split()))
ans = 0

for i in range(n):
    for j in range(n):
        if i == j:
            continue
        ans += q[i] * q[j]
    
print(ans//2) n = int(input()) n int(input()) int input() input q = list(map(int,input().split())) q list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans = 0 ans 0 for i in range(n):
    for j in range(n):
        if i == j:
            continue
        ans += q[i] * q[j]
     i range(n) range n for j in range(n):
        if i == j:
            continue
        ans += q[i] * q[j]
     j range(n) range n if i == j:
            continue
         i == j i j continue ans += q[i] * q[j] ans q[i] * q[j] q[i] q i q[j] q j print(ans//2) print ans//2 ans 2 q = list(map(int,input().split())) list(map(int,input().split())) q n = int(input()) int(input()) n ans += q[i] * q[j] q[i] * q[j] ans ans = 0 0 ans
n = int(input())
q = list(map(int,input().split()))
ans = 0

for i in range(n):
    for j in range(n):
        if i == j:
            continue
        ans += q[i] * q[j]
    
print(ans//2)