import itertools as it 
N = int(input())
d = list(map(int,input().split()))

l = list(it.combinations(d,2))

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

print(ans) import itertools as it itertools 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 l = list(it.combinations(d,2)) l list(it.combinations(d,2)) list it.combinations(d,2) it.combinations it combinations d 2 ans = 0 ans 0 for i in range(len(l)):
    ans += l[i][0] * l[i][1] i range(len(l)) range len(l) len l ans += l[i][0] * l[i][1] ans l[i][0] * l[i][1] l[i][0] [i] l i 0 l[i][1] [i] l i 1 print(ans) print ans d = list(map(int,input().split())) list(map(int,input().split())) d N = int(input()) int(input()) N l = list(it.combinations(d,2)) list(it.combinations(d,2)) l ans = 0 0 ans ans += l[i][0] * l[i][1] l[i][0] * l[i][1] ans
import itertools as it 
N = int(input())
d = list(map(int,input().split()))

l = list(it.combinations(d,2))

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

print(ans)