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