import math
import itertools
n = int(input())
d =list(map(int,input().split()))

p = list(itertools.combinations(d, 2))
ans = 0
for i in range(len(p)):
    d = p[i][0] * p[i][1]
    ans = ans + d

print(ans) import math math import itertools itertools 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 p = list(itertools.combinations(d, 2)) p list(itertools.combinations(d, 2)) list itertools.combinations(d, 2) itertools.combinations itertools combinations d 2 ans = 0 ans 0 for i in range(len(p)):
    d = p[i][0] * p[i][1]
    ans = ans + d i range(len(p)) range len(p) len p d = p[i][0] * p[i][1] d p[i][0] * p[i][1] p[i][0] [i] p i 0 p[i][1] [i] p i 1 ans = ans + d ans ans + d ans d print(ans) print ans p = list(itertools.combinations(d, 2)) list(itertools.combinations(d, 2)) p d = p[i][0] * p[i][1] p[i][0] * p[i][1] d ans = 0 0 ans n = int(input()) int(input()) n ans = ans + d ans + d ans d =list(map(int,input().split())) list(map(int,input().split())) d
import math
import itertools
n = int(input())
d =list(map(int,input().split()))

p = list(itertools.combinations(d, 2))
ans = 0
for i in range(len(p)):
    d = p[i][0] * p[i][1]
    ans = ans + d

print(ans)