#include <bits/stdc++.h>
using namespace std;
int arr[26];
int main() {
  long long int n, maxx = 0, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    maxx = (maxx >= arr[i] ? maxx : arr[i]);
  }
  sort(arr, arr + n);
  long long int temp = maxx + 1;
  for (int i = n - 1; i >= 0; i--) {
    if (arr[i] >= temp) {
      arr[i] = (temp - 1 >= 0 ? temp - 1 : 0);
      ans += (temp - 1 >= 0 ? temp - 1 : 0);
      temp--;
    } else {
      temp = arr[i];
      ans += arr[i];
    }
  }
  cout << ans << endl;
}
