#include <bits/stdc++.h>
using namespace std;
map<long long, bool> m;
long long n;
long long a[30];
long long ans;
int main() {
  cin >> n;
  for (long long i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (long long i = n; i >= 1; --i) {
    while (m[a[i]]) a[i]--;
    if (a[i] < 0) break;
    m[a[i]] = 1;
    ans += a[i];
  }
  cout << ans << endl;
  return 0;
}
