n = int(input())

d = [int(x) for x in input().split()]

result = 0

for i in range(len(d)):
    for h in range(i+1,len(d)):

        result += d[i] * d[h]

print(result) n = int(input()) n int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x d = [int(x) for x in input().split()] d [int(x) for x in input().split()] result = 0 result 0 for i in range(len(d)):
    for h in range(i+1,len(d)):

        result += d[i] * d[h] i range(len(d)) range len(d) len d for h in range(i+1,len(d)):

        result += d[i] * d[h] h range(i+1,len(d)) range i+1 i 1 len(d) len d result += d[i] * d[h] result d[i] * d[h] d[i] d i d[h] d h print(result) print result result = 0 0 result n = int(input()) int(input()) n d = [int(x) for x in input().split()] [int(x) for x in input().split()] d result += d[i] * d[h] d[i] * d[h] result
n = int(input())

d = [int(x) for x in input().split()]

result = 0

for i in range(len(d)):
    for h in range(i+1,len(d)):

        result += d[i] * d[h]

print(result)