import itertools


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

ans = 0
for v in itertools.combinations(D,2):
    ans += v[0]*v[1]

print(ans) import itertools itertools 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()] ans = 0 ans 0 for v in itertools.combinations(D,2):
    ans += v[0]*v[1] v itertools.combinations(D,2) itertools.combinations itertools combinations D 2 ans += v[0]*v[1] ans v[0]*v[1] v[0] v 0 v[1] v 1 print(ans) print ans ans += v[0]*v[1] v[0]*v[1] ans D = [int(x) for x in input().split()] [int(x) for x in input().split()] D N = int(input()) int(input()) N ans = 0 0 ans
import itertools


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

ans = 0
for v in itertools.combinations(D,2):
    ans += v[0]*v[1]

print(ans)
