from itertools import accumulate

N=int(input())
d=[int(i) for i in input().split()]
hp=[]

for i in range(N):
    for j in range(N):
        if i>j:
            hp.append(d[i]*d[j])
l=list(accumulate(hp))
print(l[-1]) from itertools import accumulate N=int(input()) N int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i d=[int(i) for i in input().split()] d [int(i) for i in input().split()] hp=[] hp [] for i in range(N):
    for j in range(N):
        if i>j:
            hp.append(d[i]*d[j]) i range(N) range N for j in range(N):
        if i>j:
            hp.append(d[i]*d[j]) j range(N) range N if i>j:
            hp.append(d[i]*d[j]) i>j i j hp.append(d[i]*d[j]) hp.append hp append d[i]*d[j] d[i] d i d[j] d j l=list(accumulate(hp)) l list(accumulate(hp)) list accumulate(hp) accumulate hp print(l[-1]) print l[-1] l -1 hp=[] [] hp l=list(accumulate(hp)) list(accumulate(hp)) l N=int(input()) int(input()) N d=[int(i) for i in input().split()] [int(i) for i in input().split()] d
from itertools import accumulate

N=int(input())
d=[int(i) for i in input().split()]
hp=[]

for i in range(N):
    for j in range(N):
        if i>j:
            hp.append(d[i]*d[j])
l=list(accumulate(hp))
print(l[-1])