#include <bits/stdc++.h>
using namespace std;
long long n, x[27], answer, i, c = 1e18;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x[i];
  }
  sort(x, x + n);
  reverse(x, x + n);
  for (i = 0; i < n; i++) {
    if (x[i] == 0) {
      break;
    }
    if (c > x[i]) {
      answer += x[i];
      c = x[i];
    } else {
      x[i]--;
      i--;
    }
  }
  cout << answer;
}
