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