#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, sum, m;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  sum = 0;
  m = 0;
  for (int i = 0; i < N; i++) {
    sum = a.at(i) + sum;
  }
  for (int n = 2; n < N; n++) {
    m = m + n - 1;
    if (n + 1 == N) {
      break;
    }
  }
  cout << sum * m << endl;
}
