#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(v) (v).begin(), (v).end() using ll = long long; using P = pair; constexpr int INF = 1e9; constexpr long long LINF = 1e18; constexpr long long MOD = 1e9 + 7; signed main() { int n; cin >> n; int a[n]; rep(i, n) { cin >> a[i]; } ll ans = 0; rep(i, n) { ans += a[i] * (i + 1) * (n - i); } cout << ans << endl; return 0; }