#include int ri() { int n; scanf("%d", &n); return n; } int main() { int n = ri(); int64_t res = 0; for (int i = 0; i < n; i++) res += (int64_t) (i + 1) * (n - i) * ri(); printf("%" PRId64 "\n", res); return 0; }