import os, sys, re, math

N = int(input())
D = [int(n) for n in input().split()]

value = 0
for i in range(len(D) - 1):
    for j in range(i + 1, len(D)):
        value += D[i] * D[j]

print(value) import os, sys, re, math os sys re math N = int(input()) N int(input()) int input() input int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n D = [int(n) for n in input().split()] D [int(n) for n in input().split()] value = 0 value 0 for i in range(len(D) - 1):
    for j in range(i + 1, len(D)):
        value += D[i] * D[j] i range(len(D) - 1) range len(D) - 1 len(D) len D 1 for j in range(i + 1, len(D)):
        value += D[i] * D[j] j range(i + 1, len(D)) range i + 1 i 1 len(D) len D value += D[i] * D[j] value D[i] * D[j] D[i] D i D[j] D j print(value) print value value += D[i] * D[j] D[i] * D[j] value value = 0 0 value D = [int(n) for n in input().split()] [int(n) for n in input().split()] D N = int(input()) int(input()) N
import os, sys, re, math

N = int(input())
D = [int(n) for n in input().split()]

value = 0
for i in range(len(D) - 1):
    for j in range(i + 1, len(D)):
        value += D[i] * D[j]

print(value)
