#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, c = 0, n;
  cin >> n;
  vector<long long int> a(n);
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  for (i = 0; i < n - 1;) {
    if (a[i] == a[i + 1]) {
      a[i] -= 1;
      i = 0;
    } else
      i++;
  }
  for (i = 0; i < n; i++) {
    if (a[i] > 0) c += a[i];
  }
  cout << c;
  return 0;
}
