#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, ans, x;
  cin >> n;
  vector<int> arr(n);
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    ans += arr[i];
  }
  x = (n + 1) / 2;
  if (n % 2 == 0) ans -= arr[x];
  ans *= x;
  if (n % 2 == 0) ans += arr[x];
  cout << ans;
  return 0;
}
