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