#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const int N = 1e6 + 9;
int A[N];
void solve() {
  int a, b, n, k;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> A[i];
  }
  sort(A, A + n);
  long long s = 0;
  for (int i = 0; i < k; ++i) s += A[i];
  cout << s << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  int T = 1, cas = 0;
  while (T--) {
    solve();
  }
  return 0;
}
