from itertools import combinations as cmb
n = int(input())
D = list(map(int, input().split()))

ans = 0
for c in cmb(D, 2):
    ans += c[0]*c[1]
print(ans) from itertools import combinations as cmb 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 ans = 0 ans 0 for c in cmb(D, 2):
    ans += c[0]*c[1] c cmb(D, 2) cmb D 2 ans += c[0]*c[1] ans c[0]*c[1] c[0] c 0 c[1] c 1 print(ans) print ans ans = 0 0 ans ans += c[0]*c[1] c[0]*c[1] ans n = int(input()) int(input()) n D = list(map(int, input().split())) list(map(int, input().split())) D
from itertools import combinations as cmb
n = int(input())
D = list(map(int, input().split()))

ans = 0
for c in cmb(D, 2):
    ans += c[0]*c[1]
print(ans)