#include <bits/stdc++.h>
using namespace std;
const int maxx = 27;
vector<int> v;
int main() {
  long long n, l, sum = 0;
  cin >> n;
  for (int(i) = (0); (i) < (n); (i)++) {
    cin >> l;
    v.push_back(l);
  }
  sort(v.begin(), v.end());
  n = n - 1;
  while (v.size() > 1) {
    int n = v.size() - 1;
    int x = v[n];
    if (v[n] == v[n - 1]) {
      v[n]--;
      sort(v.begin(), v.end());
      continue;
    }
    sum += v[n];
    if (v[v.size() - 1] <= 0) break;
    v.pop_back();
  }
  if (v[0] > 0) sum += v[0];
  cout << sum;
  return 0;
}
