import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
Ds = list(mapint())

ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        ans += Ds[i]*Ds[j]

print(ans) import sys sys def input(): return sys.stdin.readline().strip() input def mapint(): return map(int, input().split()) mapint sys.setrecursionlimit(10**9) sys.setrecursionlimit sys setrecursionlimit 10**9 10 9 N = int(input()) N int(input()) int input() input Ds = list(mapint()) Ds list(mapint()) list mapint() mapint ans = 0 ans 0 for i in range(N-1):
    for j in range(i+1, N):
        ans += Ds[i]*Ds[j] i range(N-1) range N-1 N 1 for j in range(i+1, N):
        ans += Ds[i]*Ds[j] j range(i+1, N) range i+1 i 1 N ans += Ds[i]*Ds[j] ans Ds[i]*Ds[j] Ds[i] Ds i Ds[j] Ds j print(ans) print ans def input(): return sys.stdin.readline().strip() def input(): return sys.stdin.readline().strip() input N = int(input()) int(input()) N ans += Ds[i]*Ds[j] Ds[i]*Ds[j] ans def mapint(): return map(int, input().split()) def mapint(): return map(int, input().split()) mapint ans = 0 0 ans Ds = list(mapint()) list(mapint()) Ds
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
Ds = list(mapint())

ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        ans += Ds[i]*Ds[j]

print(ans)