#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, k;
  cin >> n >> k;
  long long arr[n];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    sum += arr[i];
  }
  cout << sum << endl;
}
