#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, k;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  int ans = 0;
  for (int i = 0; i < k; i++) {
    ans += arr[i];
  }
  cout << ans;
  cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << " sec\n";
  ;
  return 0;
}
