#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a[100], max = 1000000010, ans = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  for (int i = n - 1; i >= 0; --i) {
    if (a[i] < max) {
      ans += a[i];
      max = a[i] - 1;
    } else if (max > 0) {
      ans += max;
      max--;
    }
  }
  cout << ans;
  return 0;
}
