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