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