#include #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int n; cin >> n; vector a(n); rep(i, n) cin >> a[i]; ll ans = 0; rep(i, n) { ans += (ll)a[i]*(i+1)*(n-i); } cout << ans << '\n'; return 0; }