#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> v;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.rbegin(), v.rend());
  long long kim = n + 1;
  long long sum = 0;
  for (long long j = 0; j < n; j++) {
    long long d = kim * v[j];
    sum += d;
    kim--;
  }
  sum -= v[0];
  cout << sum << endl;
  return 0;
}
