#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  unsigned long long p = 0;
  sort(a, a + n);
  int i, j;
  while (true) {
    for (i = n - 2; i >= 0; i--) {
      if (a[i] == a[i + 1] && a[i] != 0) {
        if (a[i] >= 1) a[i] -= 1;
        break;
      }
    }
    if (i <= 0)
      break;
    else
      sort(a, a + n);
  }
  for (int i = 0; i < n; i++) p += a[i];
  cout << p;
}
