from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
import math
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math as M
MOD=10**9+7
import sys
#####################################
n=int(input())
A=INPUT()
s=0
for i in range(n):
    for j in range(i+1,n):
        s+=A[i]*A[j]
print(s) from sys import stdin,stdout def INPUT():return list(int(i) for i in stdin.readline().split()) INPUT import math math def inp():return stdin.readline() inp def out(x):return stdout.write(x) out x x import math as M math MOD=10**9+7 MOD 10**9+7 10**9 10 9 7 import sys sys n=int(input()) n int(input()) int input() input A=INPUT() A INPUT() INPUT s=0 s 0 for i in range(n):
    for j in range(i+1,n):
        s+=A[i]*A[j] i range(n) range n for j in range(i+1,n):
        s+=A[i]*A[j] j range(i+1,n) range i+1 i 1 n s+=A[i]*A[j] s A[i]*A[j] A[i] A i A[j] A j print(s) print s def out(x):return stdout.write(x) def out(x):return stdout.write(x) out def inp():return stdin.readline() def inp():return stdin.readline() inp s+=A[i]*A[j] A[i]*A[j] s MOD=10**9+7 10**9+7 MOD A=INPUT() INPUT() A def INPUT():return list(int(i) for i in stdin.readline().split()) def INPUT():return list(int(i) for i in stdin.readline().split()) INPUT s=0 0 s n=int(input()) int(input()) n
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
import math
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math as M
MOD=10**9+7
import sys
#####################################
n=int(input())
A=INPUT()
s=0
for i in range(n):
    for j in range(i+1,n):
        s+=A[i]*A[j]
print(s)
