#include<stdio.h>
#include<vector>
#include<iostream>

using namespace std;

int main() {

  int N, K;
  cin >> N >> K;
  vector<int> price(N);
  for(int i=0;i<N;i++) {
    cin >> price[i];
  }
  sort(price.begin(), price.end());
  sum = 0;
  for(auto i: price) {sum+=i;}
  cout << sum << endl;
    

}