import sys
input = sys.stdin.readline

n=int(input())
L=list(map(int,input().split()))

ans = 0
for i in range(n):
    for j in range(i+1,n):
        ans += L[i]*L[j]
print(ans)
 import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline n=int(input()) n int(input()) int input() input L=list(map(int,input().split())) L 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):
        ans += L[i]*L[j] i range(n) range n for j in range(i+1,n):
        ans += L[i]*L[j] j range(i+1,n) range i+1 i 1 n ans += L[i]*L[j] ans L[i]*L[j] L[i] L i L[j] L j print(ans) print ans L=list(map(int,input().split())) list(map(int,input().split())) L input = sys.stdin.readline sys.stdin.readline input n=int(input()) int(input()) n ans = 0 0 ans ans += L[i]*L[j] L[i]*L[j] ans
import sys
input = sys.stdin.readline

n=int(input())
L=list(map(int,input().split()))

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

