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