#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int v[n];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    ans += v[i];
  }
  sort(v, v + n);
  for (int i = 0; i < n - 1; i++) {
    ans -= (double)v[i] * v[i + 1] / 2;
    v[i + 1] = v[i] * v[i + 1] / 2;
  }
  cout << ans << endl;
}
