from itertools import combinations
N = int(input())
d = list(map(int,input().split()))
C = list(combinations(range(0,N),2))

ans = 0
for x,y in C:
  ans += d[x] * d[y]

print(ans) from itertools import combinations 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 C = list(combinations(range(0,N),2)) C list(combinations(range(0,N),2)) list combinations(range(0,N),2) combinations range(0,N) range 0 N 2 ans = 0 ans 0 for x,y in C:
  ans += d[x] * d[y] x y C ans += d[x] * d[y] ans d[x] * d[y] d[x] d x d[y] d y print(ans) print ans d = list(map(int,input().split())) list(map(int,input().split())) d ans = 0 0 ans ans += d[x] * d[y] d[x] * d[y] ans N = int(input()) int(input()) N C = list(combinations(range(0,N),2)) list(combinations(range(0,N),2)) C
from itertools import combinations
N = int(input())
d = list(map(int,input().split()))
C = list(combinations(range(0,N),2))

ans = 0
for x,y in C:
  ans += d[x] * d[y]

print(ans)