#include //#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //using namespace atcoder; using namespace std; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) using Graph = vector>>; int main() { ll N; cin >> N; ll A; ll an = 0; rep(i, N) { cin >> A; an += (i + 1) * (N - i) * A; } cout << an << endl; }