#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n;
  long long score = 0;
  cin >> n;
  vector<long long int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  for (int i = 0; i < n - 1; i++) score = score + ((i + 2) * v[i]);
  score = score + (n * v[n - 1]);
  cout << score;
  return 0;
}
