#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a[26], i, j, sum, x, y;
  set<long long> s;
  s.clear();
  scanf("%lld", &n);
  for (i = 0; i < n; i++) scanf("%lld", &a[i]);
  sort(a, a + n);
  sum = 0;
  for (i = 0; i < n; i++) {
    x = s.size();
    y = a[i];
    s.insert(y);
    while (x == s.size()) {
      y--;
      if (y == 0) break;
      s.insert(y);
    }
    if (y > 0) sum += y;
  }
  printf("%lld\n", sum);
  return 0;
}
