local n = io.read("*n")
local t = {}
for i = 1, n do
  table.insert(t, io.read("*n"))
end
local ans = 0
for i = 1, #t - 1 do
  local sum = 0
  for j = i + 1, #t do
    sum = sum + t[j]
  end
  ans = ans + sum*t[i]
end
print(ans)