#include <bits/stdc++.h>
int main() {
  long long num[30];
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &num[i]);
  for (int i = 1; i < n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (num[i] < num[j]) {
        long long temp = num[i];
        num[i] = num[j];
        num[j] = temp;
      }
    }
  long long sum = 0;
  long long bef = num[1] + 1;
  for (int i = 1; i <= n; i++) {
    if (num[i] < bef) {
      sum += num[i];
      bef = num[i];
    } else {
      sum += bef - 1;
      bef--;
    }
    if (bef == 0) break;
  }
  printf("%I64d\n", sum);
  return 0;
}
