import java.util.Arrays;
import java.util.Scanner;
public class P11399 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int answer = 0, n = sc.nextInt(), a[] = new int[n], acc = 0;
for (int i = 0; i < n; i++) {
a[i] = sc.nextInt();
}
Arrays.sort(a);
for (int ele : a) {
acc += ele;
answer += acc;
}
System.out.println(answer);
sc.close();
}
}