#include <bits/stdc++.h>
using namespace std;
long long int arr[27];
int main() {
  long long int n, i, j, store, res = 0;
  cin >> n;
  for (i = 0; i < n; i++) cin >> arr[i];
  sort(arr, (arr + n));
  i = n - 1, j = n - 2, store = arr[n - 1];
  while (j > -1) {
    if (arr[j] >= arr[i]) {
      arr[j] = arr[i] - 1;
      if (arr[j] < 0) arr[j] = 0;
    }
    j--;
    i--;
  }
  for (i = 0; i < n; i++) {
    res += arr[i];
  }
  cout << res << '\n';
  return 0;
}
