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