function Main(input) {
	let [n, Arr] = input.split('\n')
    Arr = Arr.split(' ').map(e=>Number(e))
  	let result = 0
  	Arr.forEach((e,i)=>{	
      	let j = 1
    	while(i+j<Arr.length){
          	result = result + e*Arr[i+j]
        	j++
        }
    })
  	console.log(result)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));