import math
import itertools

N = int(input())
A = list(map(int, input().split()))
ans = []

for i in itertools.combinations(A,2):
    a,b = int(i[0]), int(i[1])
    s = a*b
    ans.append(s)

print(sum(ans)) import math math import itertools itertools N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = [] ans [] for i in itertools.combinations(A,2):
    a,b = int(i[0]), int(i[1])
    s = a*b
    ans.append(s) i itertools.combinations(A,2) itertools.combinations itertools combinations A 2 a,b = int(i[0]), int(i[1]) a int(i[0]) int i[0] i 0 b int(i[1]) int i[1] i 1 s = a*b s a*b a b ans.append(s) ans.append ans append s print(sum(ans)) print sum(ans) sum ans s = a*b a*b s A = list(map(int, input().split())) list(map(int, input().split())) A ans = [] [] ans N = int(input()) int(input()) N a,b = int(i[0]), int(i[1]) int(i[0]) a b = int(i[0]), int(i[1]) int(i[1]) b
import math
import itertools

N = int(input())
A = list(map(int, input().split()))
ans = []

for i in itertools.combinations(A,2):
    a,b = int(i[0]), int(i[1])
    s = a*b
    ans.append(s)

print(sum(ans))
