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