#include <bits/stdc++.h>
int n;
int arr[30];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  std::sort(arr, arr + n);
  for (int i = n - 2; i >= 0; i--) {
    if (arr[i] >= arr[i + 1]) arr[i] = arr[i + 1] - 1;
  }
  long long result = 0;
  for (int i = 0; i < n; i++)
    if (arr[i] > 0) result += arr[i];
  std::cout << result;
}
