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