#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 100;
const int N = 1e3 + 10;
const int mod = 1e9 + 7;
const long long maxll = 9223372036854775807;
const long long minll = -9223372036854775808;
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long &e : v) cin >> e;
  sort(v.begin(), v.end());
  long long mul = 2;
  long long ans = n * v.back();
  v.pop_back();
  for (long long e : v) {
    ans += e * mul;
    mul++;
  }
  cout << ans;
  return;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  solve();
  return 0;
}
