N = int(input())
D = list(map(int, input().split()))
from itertools import accumulate
print(sum(list(d*c for d, c in zip(D[1:], accumulate(D))))) 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 from itertools import accumulate print(sum(list(d*c for d, c in zip(D[1:], accumulate(D))))) print sum(list(d*c for d, c in zip(D[1:], accumulate(D)))) sum list(d*c for d, c in zip(D[1:], accumulate(D))) list d*c d c N = int(input()) int(input()) N D = list(map(int, input().split())) list(map(int, input().split())) D
N = int(input())
D = list(map(int, input().split()))
from itertools import accumulate
print(sum(list(d*c for d, c in zip(D[1:], accumulate(D)))))
