// to be build tomorrow
#include <bits/stdc++.h>
#define ll long long
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<pair<int, int>, null_type,less<pair<int, int>>, rb_tree_tag,tree_order_statistics_node_update> 
#include <bits/stdc++.h> 
using namespace std; 
ordered_set s[200005];
struct pt {
    long long x, y;
    pt() {}
    pt(long long _x, long long _y) : x(_x), y(_y) {}
    pt operator-(const pt& p) const { return pt(x - p.x, y - p.y); }
    long long cross(const pt& p) const { return x * p.y - y * p.x; }
    long long cross(const pt& a, const pt& b) const { return (a - *this).cross(b - *this); }
};

int sgn(const long long& x) { return x >= 0 ? x ? 1 : 0 : -1; }

bool inter1(long long a, long long b, long long c, long long d) {
    if (a > b)
        swap(a, b);
    if (c > d)
        swap(c, d);
    return max(a, c) <= min(b, d);
}

bool check_inter(const pt& a, const pt& b, const pt& c, const pt& d) {
    if (c.cross(a, d) == 0 && c.cross(b, d) == 0)
        return inter1(a.x, b.x, c.x, d.x) && inter1(a.y, b.y, c.y, d.y);
    return sgn(a.cross(b, c)) != sgn(a.cross(b, d)) &&
           sgn(c.cross(d, a)) != sgn(c.cross(d, b));
}
using pp = pair <ll, ll>;
ll dp[30][30][2];
ll valid(ll f1, ll pos, string s, string cur, ll count)
{
    if (pos == s.length())
    {
        // cout << cur << "\n";
        if (stoull(cur))
        return 1;
        return 0;
    }
    if (dp[pos][count][f1] != -1)
    return dp[pos][count][f1];
    if (f1 == 1)
    {
        dp[pos][count][f1] = valid(f1, pos+1,s, cur+'0', count) + valid(f1, pos+1,s, cur + '1', count+1);   
    }
    else 
    {
        if (s[pos] == '0')
        {
            dp[pos][count][f1] = valid (f1, pos+1, s, cur+'0', count);
        }
        else if (s[pos] == '1')
        dp[pos][count][f1] = valid(0, pos+1, s, cur+'1', count+1) + valid(1, pos+1, s, cur + '0', count);
        else 
        dp[pos][count][f1] = valid(1, pos+1, s, cur+'1',count+1) + valid(1, pos+1, s, cur+'0', count);
    }
    return dp[pos][count][f1];
}
int main ()
{
ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t = 1;
    // cin >> t;
    while (t--)
    {
    ll n, k;
    cin >> n >> k;
    ll p[n];
    for (auto &i : p)
    cin >> i;
    sort(p, p+n);
    ll sum = 0;
    for (auto i : p)
    sum += i;
    cout << sum;
    }
    return 0;
}