import sys

sys.setrecursionlimit(2147483647)

INF=float("inf")

MOD=10**9+7

# input=lambda :sys.stdin.readline().rstrip()

def resolve():

    n=int(eval(input()))

    D=list(map(int,input().split()))

    ans=0

    for i in range(n):

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

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

    print(ans)

resolve()
import sys

sys.setrecursionlimit(2147483647)

INF=float("inf")

MOD=10**9+7

input=lambda:sys.stdin.readline().rstrip()

def resolve():

    n=int(eval(input()))

    A=list(map(int,input().split()))

    s=sum(A)

    t=sum(a**2 for a in A)

    print(((s**2-t)//2))

resolve()
import sys

sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7
# input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n = int(eval(input()))
    D = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        for j in range(i + 1, n):
            ans += D[i] * D[j]
    print(ans)


resolve()

import sys

sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7
input = lambda: sys.stdin.readline().rstrip()


def resolve():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    s = sum(A)
    t = sum(a**2 for a in A)
    print(((s**2 - t) // 2))


resolve()

-# input=lambda :sys.stdin.readline().rstrip() +input = lambda: sys.stdin.readline().rstrip() + + -    D = list(map(int, input().split())) -    ans = 0 -    for i in range(n): -        for j in range(i + 1, n): -            ans += D[i] * D[j] -    print(ans) +    A = list(map(int, input().split())) +    s = sum(A) +    t = sum(a**2 for a in A) +    print(((s**2 - t) // 2))