#include <bits/stdc++.h>
using namespace std;
int a[26];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int tmp = 0;
  long long ans = 0;
  sort(a, a + n, cmp);
  ans += a[0];
  tmp = a[0];
  for (int i = 1; i < n; i++) {
    if (a[i] >= tmp)
      tmp = tmp - 1;
    else
      tmp = a[i];
    if (tmp <= 0) break;
    ans += tmp;
  }
  printf("%I64d\n", ans);
  return 0;
}
