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