N=int(input()) A=list(map(int,input().split())) S=0 T=0 d=N for i in range(N): T+=d d-=2 S+=A[i]*T print(S)