n=io.read("*n")
d={}
for i=1,n do
  table.insert(d,io.read("*n"))
end

v={}
for i=1,n-1 do
  l=0
  for j=i+1,n do
    l=l+d[j]
  end
  table.insert(v,l)
end

ans=0
for i=1,n-1 do
  ans=ans+(d[i]*v[i])
end

print(ans)