#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MAX = 100;
const int INF = (1 << 12);
int main() {
  int N, K, ans;
  cin >> N;
  vector<int> p(N);
  for (int i = 0; i < N; ++i) cin >> p[i];
  sort(p.begin(), p.end());
  ans = 0;
  for (int i = 0; i < K; ++i) ans += p[i];
  cout << ans << endl;
  return 0;
}
