import sys
input = sys.stdin.readline

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

N = int(input())
d = list(map(int,input().split()))
counter = 0
for i in range(N-1):
    for j in range(i+1,N):
        counter += d[i]*d[j]
print(counter)
