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