N = int(input())
d_list = list(map(int,input().split()))

ans = 0
for i in range(N-1):
    for j in range(i+1,N):
        ans += d_list[i] * d_list[j]

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

ans = 0
for i in range(N-1):
    for j in range(i+1,N):
        ans += d_list[i] * d_list[j]

print(ans)
