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