n = int(input())
l = list(map(int,input().split(' ')))
x = 0
start = 1

for i in l:
    for j in range(start,n):
        x += (i*l[j])
    start += 1

print(x) 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 ' ' x = 0 x 0 start = 1 start 1 for i in l:
    for j in range(start,n):
        x += (i*l[j])
    start += 1 i l for j in range(start,n):
        x += (i*l[j])
     j range(start,n) range start n x += (i*l[j]) x i*l[j] i l[j] l j start += 1 start 1 print(x) print x l = list(map(int,input().split(' '))) list(map(int,input().split(' '))) l start = 1 1 start start += 1 1 start x += (i*l[j]) i*l[j] x n = int(input()) int(input()) n x = 0 0 x
n = int(input())
l = list(map(int,input().split(' ')))
x = 0
start = 1

for i in l:
    for j in range(start,n):
        x += (i*l[j])
    start += 1

print(x)