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