#include <bits/stdc++.h>
using namespace std;
set <int> guozi;
int ans=0;
int main(){
int n;
cin>>n;
for(int i=0; i<n; i++){
int wei;
cin>>wei;
guozi.insert(wei);
}
auto it=guozi.begin();
int i=0;
while(i <= n){
ans = ans+*it;
it++;
i++;
}
cout<<ans<<endl;
return 0;
}