#include /* --> Programmed by katamori1310 <-- ??? Chillin with Blue Archive */ #define int long long #define ull unsigned long long #define fi first #define se second #define aris "" using namespace std; const int MAXN = 100000; const int MOD = 1e9 + 7; const int MAXP = 1e6; const int INF = 1e18; const int MODE = MOD - 2; /* I love Aris and Kei at the same time ? ? ? Pampakapam ? ? ? */ inline void kei(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int n; int a[2 * MAXN + 5]; int pfs[2 * MAXN + 5]; void solve(){ cin >> n; int res = 0; for(int i = 1; i <= n; ++i) { int a; cin >> a; res += a * i * (n - i + 1); } cout << res << "\n"; } signed main(){ if(fopen(aris".inp", "r")){ freopen(aris".inp", "r", stdin); freopen(aris".out", "w", stdout); } kei(); int T; // cin >> T; T = 1; while(T--){ solve(); } return 0; } // ???