#include using namespace std; long long MOD = 1000000007; int MAX_N = 200000; int MAX_A = 1000000; int main(){ long long N; cin >> N; assert(N >= 1); assert(N <= MAX_N); vector A(N); for (int i = 0; i < N; i++){ cin >> A[i]; assert(A[i] >= 0); assert(A[i] <= MAX_A); } long long ans = 0; for (long long i = 0; i < N; i++){ long long M = (i + 1) * (N - i); ans = ans + A[i] * M; } cout << ans << endl; }