#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long a[50] = {0};
  cin >> n;
  map<long long, int> mp, occ;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    occ[a[i]]++;
  }
  vector<int> vec(a, a + n);
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (mp.count(vec[i])) {
      int tt = 1;
      while (1) {
        if (tt == vec[i]) break;
        if (!mp.count(vec[i] - tt)) {
          ans += vec[i] - tt;
          mp[vec[i] - tt]++;
          break;
        }
        tt++;
      }
    } else {
      mp[vec[i]]++;
      ans += vec[i];
    }
  }
  cout << ans;
  return 0;
}
