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