const main = input => {
  const inputs = input.trim().split('\n')
  const N = parseInt(inputs[0])
  const takoyakis = inputs[1].split(' ').map(x => parseInt(x))

  let sum = 0
  for (let i = 0; i < N - 1; i++) {
    for (let j = i + 1; j < N; j++) {
      sum += takoyakis[i] * takoyakis[j]
    }
  }

  console.log(sum)
}

// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
