#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (auto &a : v) cin >> a;
  sort(v.begin(), v.end(), greater<int>());
  while (1) {
    int is_duplicate = 0;
    for (int i = 1; i < n; i++) {
      if (v[i] && v[i] == v[i - 1]) {
        v[i]--;
        is_duplicate = 1;
        sort(v.begin(), v.end(), greater<int>());
        break;
      }
    }
    if (!is_duplicate) break;
  }
  long long ans = 0;
  for (auto a : v) {
    ans += a;
  }
  cout << ans << endl;
  return 0;
}
