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