def ii():return int(eval(input()))

def iim():return list(map(int,input().split()))

def iil():return list(map(int,input().split()))

def ism():return list(map(str,input().split()))

def isl():return list(map(str,input().split()))



n = ii()

D = iil()

ans = 0

for i in range(n):

    for j in range(i+1,n):

#        print(i,j)

        ans += D[i]*D[j] 

print(ans)
def ii():return int(eval(input()))

def iim():return list(map(int,input().split()))

def iil():return list(map(int,input().split()))

def ism():return list(map(str,input().split()))

def isl():return list(map(str,input().split()))



n = ii()

D = iil()

sumD = sum(D)

ans = 0

for i in range(n):

    ans += D[i]*(sum(D)-D[i])

print((ans//2))
def ii():
    return int(eval(input()))


def iim():
    return list(map(int, input().split()))


def iil():
    return list(map(int, input().split()))


def ism():
    return list(map(str, input().split()))


def isl():
    return list(map(str, input().split()))


n = ii()
D = iil()
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        #        print(i,j)
        ans += D[i] * D[j]
print(ans)

def ii():
    return int(eval(input()))


def iim():
    return list(map(int, input().split()))


def iil():
    return list(map(int, input().split()))


def ism():
    return list(map(str, input().split()))


def isl():
    return list(map(str, input().split()))


n = ii()
D = iil()
sumD = sum(D)
ans = 0
for i in range(n):
    ans += D[i] * (sum(D) - D[i])
print((ans // 2))

+sumD = sum(D) -    for j in range(i + 1, n): -        #        print(i,j) -        ans += D[i] * D[j] -print(ans) +    ans += D[i] * (sum(D) - D[i]) +print((ans // 2))