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