import sys

def input():

    return sys.stdin.readline()[:-1]

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)
import bisect

import copy

import heapq

import math

import sys

from collections import *

from functools import lru_cache

from itertools import accumulate, combinations, permutations, product

def input():

    return sys.stdin.readline()[:-1]

def ruiseki(lst):

    return [0]+list(accumulate(lst))

sys.setrecursionlimit(500000)

mod=pow(10,9)+7

al=[chr(ord('a') + i) for i in range(26)]

direction=[[1,0],[0,1],[-1,0],[0,-1]]



n=int(eval(input()))

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



ans=0

for i in range(n):

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

        # print(i,j)

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

print(ans)
import sys


def input():
    return sys.stdin.readline()[:-1]


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)

import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product


def input():
    return sys.stdin.readline()[:-1]


def ruiseki(lst):
    return [0] + list(accumulate(lst))


sys.setrecursionlimit(500000)
mod = pow(10, 9) + 7
al = [chr(ord("a") + i) for i in range(26)]
direction = [[1, 0], [0, 1], [-1, 0], [0, -1]]
n = int(eval(input()))
d = list(map(int, input().split()))
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        # print(i,j)
        ans += d[i] * d[j]
print(ans)

+import bisect +import copy +import heapq +import math +from collections import * +from functools import lru_cache +from itertools import accumulate, combinations, permutations, product +def ruiseki(lst): +    return [0] + list(accumulate(lst)) + + +sys.setrecursionlimit(500000) +mod = pow(10, 9) + 7 +al = [chr(ord("a") + i) for i in range(26)] +direction = [[1, 0], [0, 1], [-1, 0], [0, -1]] +        # print(i,j)