#include <bits/stdc++.h>
using namespace std;
const int MAXN = 30;
const int INF = 1e9 + 7;
const double eps = 1e-10;
int N, M, T = INF, Cases = 0;
long long a[MAXN];
int main() {
  while (T-- && ~(scanf("%d", &N))) {
    for (int i = 0; i < N; i++) scanf("%I64d", a + i);
    for (int i = N - 1; i >= 0; i--) {
      sort(a, a + N);
      for (int j = 1; j <= i; j++) {
        if (a[i - j] == a[i])
          a[i - j] -= j;
        else
          break;
      }
    }
    long long ans = 0;
    for (int i = 0; i < N; i++)
      if (a[i] > 0) ans += a[i];
    printf("%I64d\n", ans);
  }
  return 0;
}
