#include <bits/stdc++.h>
using namespace std;
long long arr[27];
int main() {
  long long n, i, a, b, c, ans = 0, x;
  cin >> n;
  for (i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  for (i = n - 1; i >= 0; i--) {
    if (i == n - 1) x = arr[i];
    if (i < n - 1 && arr[i] >= x) {
      b = x - 1;
      if (b < 0) b = 0;
      ans += b;
      arr[i] = b;
    } else
      ans += arr[i];
    x = arr[i];
  }
  printf("%I64d\n", ans);
  return 0;
}
