#include <iostream> 
#include <cctype> 
using namespace std; 
int main() 
{ 
    int n,k,s=0;
    int *a = new int[n];
    int q = sizeof(a)/sizeof(a[0]);
    for (int i=0;i<n;i++){
        cin>>a[i];
    }

    sort(a,a+q);
    for (int i=0;i<k;i++){
        s += a[i];
    }
    cout<<s;
    delete [] a;
    return 0
    
}