#include <bits/stdc++.h>
using namespace std;
int A[30];
int main() {
  ios_base::sync_with_stdio(false);
  int SIGMA;
  cin >> SIGMA;
  for (int i = 1; i <= SIGMA; ++i) cin >> A[i];
  sort(A + 1, A + SIGMA + 1);
  map<int, int> Map;
  A[SIGMA + 1] = -1;
  long long dimension = 0;
  for (int i = SIGMA; i >= 1; i--) {
    while (A[i] >= 1 && Map.count(A[i])) A[i]--;
    assert(A[i] >= 0);
    Map[A[i]] = 1;
    dimension += A[i];
  }
  cout << dimension << "\n";
  return 0;
}
