n = gets.to_i
ds = gets.split.map{|d| d.to_i}

sum = 0
len = ds.length

def recovery(x, y)
  return x * y
end

0.upto(len-1) do |idx|
  0.upto(len-1) do |jdx|
    next if idx == jdx
    sum += recovery(ds[idx], ds[jdx])
  end
end

puts sum / 2