#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int main() {
  int n;
  cin >> n;
  long long c[26], sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  sort(c, c + n);
  for (int i = n - 2; i >= 0; i--) {
    while (c[i] >= c[i + 1]) c[i]--;
  }
  for (int i = 0; i < n; i++) {
    if (c[i] > 0) sum += c[i];
  }
  cout << sum;
  return 0;
}
