import numpy as np
n=int(input())
d_i = list(map(int, input().split()))  
d=np.array(d_i)
out=0
for i in range(1,n):
    a=d_i.pop(0)
    d_i.append(a)
    out+=np.dot(d,np.array(d_i))
print(int(out/2)) import numpy as np numpy n=int(input()) n int(input()) int input() input d_i = list(map(int, input().split())) d_i list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split d=np.array(d_i) d np.array(d_i) np.array np array d_i out=0 out 0 for i in range(1,n):
    a=d_i.pop(0)
    d_i.append(a)
    out+=np.dot(d,np.array(d_i)) i range(1,n) range 1 n a=d_i.pop(0) a d_i.pop(0) d_i.pop d_i pop 0 d_i.append(a) d_i.append d_i append a out+=np.dot(d,np.array(d_i)) out np.dot(d,np.array(d_i)) np.dot np dot d np.array(d_i) np.array np array d_i print(int(out/2)) print int(out/2) int out/2 out 2 n=int(input()) int(input()) n out=0 0 out d_i = list(map(int, input().split())) list(map(int, input().split())) d_i out+=np.dot(d,np.array(d_i)) np.dot(d,np.array(d_i)) out d=np.array(d_i) np.array(d_i) d a=d_i.pop(0) d_i.pop(0) a
import numpy as np
n=int(input())
d_i = list(map(int, input().split()))  
d=np.array(d_i)
out=0
for i in range(1,n):
    a=d_i.pop(0)
    d_i.append(a)
    out+=np.dot(d,np.array(d_i))
print(int(out/2))