#include <bits/stdc++.h>
using namespace std;
long long n, a[33], ans;
map<long long, long long> us;
int main() {
  cin >> n;
  for (long long i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + 1 + n);
  for (long long i = 1; i <= n; ++i) {
    while (us[a[i]] && a[i] > 0) a[i]--;
    ans += a[i];
    us[a[i]] = 1;
  }
  cout << ans;
}
