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