import sys
from sys import stdin

INF = float("inf")
def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


n = I()
d = LI()
hp = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        hp += d[i] * d[j]
print(hp) import sys sys from sys import stdin INF = float("inf") INF float("inf") float "inf" def input(): return sys.stdin.readline().strip() input def I(): return int(input()) I def LI(): return list(map(int, input().split())) LI I() for i in range(n) for i in range(n) i range(n) range n for i in range(n) I() I def IR(n): return [I() for i in range(n)] IR n n LI() for i in range(n) for i in range(n) i range(n) range n for i in range(n) LI() LI def LIR(n): return [LI() for i in range(n)] LIR n n S() for i in range(n) for i in range(n) i range(n) range n for i in range(n) S() S def SR(n): return [S() for i in range(n)] SR n n def S(): return input() S def LS(): return input().split() LS n = I() n I() I d = LI() d LI() LI hp = 0 hp 0 for i in range(n - 1):
    for j in range(i + 1, n):
        hp += d[i] * d[j] i range(n - 1) range n - 1 n 1 for j in range(i + 1, n):
        hp += d[i] * d[j] j range(i + 1, n) range i + 1 i 1 n hp += d[i] * d[j] hp d[i] * d[j] d[i] d i d[j] d j print(hp) print hp def SR(n): return [S() for i in range(n)] def SR(n): return [S() for i in range(n)] SR hp += d[i] * d[j] d[i] * d[j] hp hp = 0 0 hp n = I() I() n d = LI() LI() d def LS(): return input().split() def LS(): return input().split() LS def input(): return sys.stdin.readline().strip() def input(): return sys.stdin.readline().strip() input def IR(n): return [I() for i in range(n)] def IR(n): return [I() for i in range(n)] IR INF = float("inf") float("inf") INF def S(): return input() def S(): return input() S def LIR(n): return [LI() for i in range(n)] def LIR(n): return [LI() for i in range(n)] LIR def LI(): return list(map(int, input().split())) def LI(): return list(map(int, input().split())) LI def I(): return int(input()) def I(): return int(input()) I
import sys
from sys import stdin

INF = float("inf")
def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


n = I()
d = LI()
hp = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        hp += d[i] * d[j]
print(hp)
