n=int(input())
d=[int(x) for x in input().rstrip().split()]

ans=0
for i in range(n):
    for j in range(i+1,n):
        ans+=d[i]*d[j]
print(ans) n=int(input()) n int(input()) int input() input int(x) for x in input().rstrip().split() for x in input().rstrip().split() x input().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () input rstrip split for x in input().rstrip().split() int(x) int x d=[int(x) for x in input().rstrip().split()] d [int(x) for x in input().rstrip().split()] ans=0 ans 0 for i in range(n):
    for j in range(i+1,n):
        ans+=d[i]*d[j] i range(n) range n for j in range(i+1,n):
        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=[int(x) for x in input().rstrip().split()] [int(x) for x in input().rstrip().split()] d ans+=d[i]*d[j] d[i]*d[j] ans n=int(input()) int(input()) n ans=0 0 ans
n=int(input())
d=[int(x) for x in input().rstrip().split()]

ans=0
for i in range(n):
    for j in range(i+1,n):
        ans+=d[i]*d[j]
print(ans)