from itertools import combinations

n = int(input())
D = list(map(int, input().split()))

xy = list(combinations(D,2))
ans = 0

for i in range(len(xy)):
    ans += xy[i][0]*xy[i][1]

print(ans) from itertools import combinations n = int(input()) n int(input()) int input() input D = list(map(int, input().split())) D list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split xy = list(combinations(D,2)) xy list(combinations(D,2)) list combinations(D,2) combinations D 2 ans = 0 ans 0 for i in range(len(xy)):
    ans += xy[i][0]*xy[i][1] i range(len(xy)) range len(xy) len xy ans += xy[i][0]*xy[i][1] ans xy[i][0]*xy[i][1] xy[i][0] [i] xy i 0 xy[i][1] [i] xy i 1 print(ans) print ans ans += xy[i][0]*xy[i][1] xy[i][0]*xy[i][1] ans ans = 0 0 ans xy = list(combinations(D,2)) list(combinations(D,2)) xy n = int(input()) int(input()) n D = list(map(int, input().split())) list(map(int, input().split())) D
from itertools import combinations

n = int(input())
D = list(map(int, input().split()))

xy = list(combinations(D,2))
ans = 0

for i in range(len(xy)):
    ans += xy[i][0]*xy[i][1]

print(ans)
