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