#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
long long n, k;
vector<long long> a(N);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long sum = 0;
  for (long long i = 0; i < k; i++) sum += a[i];
  cout << sum;
}
