#include<bits/stdc++.h>
using namespace std;
#define push_back pb
#define sz(a) int((a).size())
#define all(c) c.begin(),c.end()
#define tr(container, it) \
for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define present(container, element) (container.find(element) != container.end())
#define cpresent(container, element) ((find(all(container),element) != container.end())
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
     int n,x;
     cin>>n;
     vi v(n);
     for(int i=0;i<n;i++)
     {
             cin>>v[i];
     }
     sort(v,v+n);
     int s=0;
     for(int i=0;i<x;i++)
     {
             s+=v[i];
     }
     cout<<s;

}
