#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n + 1);
  for (long long i = 1; i <= n; i += 1) cin >> a[i];
  sort(a.begin() + 1, a.end());
  long long ans = 0;
  for (long long i = 1; i <= n - 1; i += 1) {
    ans += a[i] * (i + 1);
  }
  ans += a[n] * n;
  cout << ans << endl;
  return 0;
}
