import java.util.*;
import java.util.stream.IntStream;
import java.util.stream.LongStream;

public class Main {
    public static void main(String[] args) {
       Scanner scanner = new Scanner(System.in);
       int n = scanner.nextInt();
       long[] a = new long[n];
        int sum = 0;
        for (int i = 0; i < n; i++) {
            a[i]=scanner.nextInt();
        }
        Arrays.sort(a);
        for (int i = 0; i < a.length/2; i++) {
            long tmp = a[i];
            a[i]=a[a.length-i-1];
            a[a.length-i-1]=tmp;
        }




        int i=0;
        while (LongStream.of(a).sum()>0){
            //System.out.println(IntStream.of(a).sum());
            //System.out.println("p");
            long b = a[0];
            for (int j = 0; j < n; j++) {
                if (a[j]!=b){
                    if (a[j]-1<=0)a[j]=0;
                    else a[j]--;
                }

            }
            a[0]=0;
            i++;
            Arrays.sort(a);
            for (int k = 0; k < a.length/2; k++) {
                long tmp = a[k];
                a[k]=a[a.length-k-1];
                a[a.length-k-1]=tmp;
            }
            sum+=b;
            //System.out.println(Arrays.toString(a));
        }
        System.out.println(sum);
    }
}