#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n, k, s;
  cin >> n >> k;
  vector<int> t;
  for (int i = 0; i < (int)(n); i++) {
    cin >> s;
    t.push_back(s);
  }
  sort(t.begin(), t.end());
  int p = 0;
  for (int i = 0; i < (int)(n); i++) {
    p = p + t[i];
  }
  cout << p << endl;
  return 0;
}
