#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, c = 0, i;
  cin >> N;
  int a[N];
  for (i = 0; i < N; i++) {
    cin >> a[i];
  }
  sort(a, a + N);
  i = 1;
  while (i < N) {
    if (a[i] != a[i - 1]) {
      c += a[i];
    }
    i++;
  }
  cout << c + a[0] << endl;
}
