import itertools

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

takocombi=list(itertools.combinations([i for i in range(N)],2))

ans=0
for h in range(len(takocombi)):
	ans+=D[takocombi[h][0]]*D[takocombi[h][1]]

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

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

takocombi=list(itertools.combinations([i for i in range(N)],2))

ans=0
for h in range(len(takocombi)):
	ans+=D[takocombi[h][0]]*D[takocombi[h][1]]

print(ans)