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