#include <bits/stdc++.h>
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return ((a * b) / gcd(a, b)); }
using namespace std;
map<int, int> took;
int f(int n) {
  while (took[n] == 1) n--;
  if (n != 0) took[n] = 1;
  return n;
}
int main() {
  int a, b, c, i, j, k, tc, t;
  int n, m;
  long long cnt = 0;
  cin >> n;
  int ara[10004];
  for (i = 0; i < n; i++) cin >> ara[i];
  sort(ara, ara + n);
  for (i = 0; i < n; i++) {
    cnt += (long long)(f(ara[i]));
  }
  printf("%lld\n", cnt);
  return 0;
}
