#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  int sum = 0;
  if (N % 2 == 0) {
    for (int ai : A) {
      sum += ai * N / 2;
    }
  } else {
    for (int i = 0; i < N; i++) {
      if (A.at(i) != N / 2) {
        sum += A.at(i) * (N - 1) / 2;
      }
    }
  }
  cout << sum << endl;
}
