#include <bits/stdc++.h>
using namespace std;
long long tra[10000];
int main() {
  long long t;
  cin >> t;
  long long str[t + 5];
  for (int i = 1; i <= t; i++) {
    cin >> str[i];
  }
  long long h = t / 2;
  long long sum = 0;
  if (t % 2 != 0) h++;
  for (int i = 1; i <= t / 2; i++) {
    if (t % 2 == 0) {
      sum += (h * str[i]) + (h * (str[(t / 2) + i]));
    } else {
      sum += (h * str[i]) + (h * (str[(t / 2) + i + 1]));
    }
  }
  if (t % 2 != 0) sum += str[(t / 2) + 1];
  cout << sum << endl;
}
