#include <bits/stdc++.h>
using namespace std;
int n;
long long temp[300005];
int main(void) {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &temp[i]);
  long long ans = 0;
  sort(temp + 1, temp + 1 + n);
  long long ok = 2;
  for (int i = 1; i < n; i++) {
    ans = ans + temp[i] * ok;
    ok++;
  }
  ans = ans + temp[n] * n;
  printf("%I64d\n", ans);
}
