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(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 bisect import copy copy import heapq heapq import math math import sys sys from collections import * from functools import lru_cache from itertools import accumulate, combinations, permutations, product def input():
    return sys.stdin.readline()[:-1] input return sys.stdin.readline()[:-1] sys.stdin.readline()[:-1] sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline :-1 -1 def ruiseki(lst):
    return [0]+list(accumulate(lst)) ruiseki return [0]+list(accumulate(lst)) [0]+list(accumulate(lst)) [0] 0 list(accumulate(lst)) list accumulate(lst) accumulate lst lst lst sys.setrecursionlimit(500000) sys.setrecursionlimit sys setrecursionlimit 500000 mod=pow(10,9)+7 mod pow(10,9)+7 pow(10,9) pow 10 9 7 chr(ord('a') + i) for i in range(26) for i in range(26) i range(26) range 26 for i in range(26) chr(ord('a') + i) chr ord('a') + i ord('a') ord 'a' i al=[chr(ord('a') + i) for i in range(26)] al [chr(ord('a') + i) for i in range(26)] direction=[[1,0],[0,1],[-1,0],[0,-1]] direction [[1,0],[0,1],[-1,0],[0,-1]] [1,0] 1 0 [0,1] 0 1 [-1,0] -1 0 [0,-1] 0 -1 n=int(input()) n int(input()) int input() input d=list(map(int,input().split())) d list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans=0 ans 0 for i in range(n):
    for j in range(i+1,n):
        # print(i,j)
        ans+=d[i]*d[j] i range(n) range n for j in range(i+1,n):
        # print(i,j)
        ans+=d[i]*d[j] j range(i+1,n) range i+1 i 1 n ans+=d[i]*d[j] ans d[i]*d[j] d[i] d i d[j] d j print(ans) print ans d=list(map(int,input().split())) list(map(int,input().split())) d ans+=d[i]*d[j] d[i]*d[j] ans def input():
    return sys.stdin.readline()[:-1] def input():
    return sys.stdin.readline()[:-1] input direction=[[1,0],[0,1],[-1,0],[0,-1]] [[1,0],[0,1],[-1,0],[0,-1]] direction ans=0 0 ans n=int(input()) int(input()) n def ruiseki(lst):
    return [0]+list(accumulate(lst)) def ruiseki(lst):
    return [0]+list(accumulate(lst)) ruiseki mod=pow(10,9)+7 pow(10,9)+7 mod al=[chr(ord('a') + i) for i in range(26)] [chr(ord('a') + i) for i in range(26)] al
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(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)