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