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