#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[27];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n, greater<int>());
  long long ans = a[0];
  long long pre = a[0];
  long long cnt = 0;
  for (int i = 1; i < n; ++i) {
    if (a[i] == pre) {
      ++cnt;
    } else {
      ans += a[i];
      for (int j = pre - 1; j > a[i]; --j) {
        if (cnt == 0) break;
        ans += j;
        --cnt;
      }
    }
    pre = a[i];
  }
  if (a[n - 1] > 1 && cnt > 0) {
    for (int j = a[n - 1] - 1; j >= 1; --j) {
      if (cnt == 0) {
        break;
      }
      ans += j;
      --cnt;
    }
  }
  cout << ans << endl;
  return 0;
}
