#include <bits/stdc++.h>
using namespace std;
vector<unsigned long long> te;
int main() {
  unsigned long long n, x, s = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    te.push_back(x);
  }
  sort(te.begin(), te.end());
  for (int i = 0; i < n - 1; i++) {
    s += te[i] * (i + 2);
  }
  s += te[n - 1] * n;
  cout << s;
  return 0;
}
