class Problem
  attr_accessor :a, :b, :n, :m, :h, :w, :x, :y, :s ,:t, :k

  def initialize
    @n = gets.to_s.to_i
    @a = gets.to_s.split.map{ |v| v.to_i }
  end

  def solve
    ans = 0
    0.upto(n-2) do |i|
      (i+1).upto(n-1) do |j|
        ans += a[i] * a[j]
      end
    end
    ans
  end

  def show(ans)
    puts ans
  end
end

Problem.new.instance_eval do
  show(solve)
end
