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