#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int arr[N];
  for (int i = 0; i < N; ++i) {
    cin >> arr[i];
  }
  long res = 0;
  sort(arr, arr + N);
  for (int j = 0; j < N; ++j) {
    if (j != 0) {
      if (arr[j] == arr[j - 1]) {
        continue;
      }
    }
    res += arr[j];
  }
  cout << res;
}
