(def N (read))
(def d (for [i (range 0 N)] (read)))

(println (loop [sum 0 i 0 j 1]
  (if (>= i N)
    sum
    (if (>= j N)
      (recur sum (+ i 1) (+ i 2))
      (recur (+ sum (* (nth d i) (nth d j))) i (+ j 1))))))