#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  vector<int> arr;
  for (int i = 0; i < n; i++) {
    int inp;
    cin >> inp;
    arr.push_back(inp);
  }
  int tmp;
  for (int i = n - 1; i > 0; i--) {
    for (int j = 0; j <= i - 1; j++) {
      if (arr[j] > arr[j + 1]) {
        tmp = arr[j];
        arr[j] = arr[j + 1];
        arr[j + 1] = tmp;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < k; i++) {
    ans = ans + arr[i];
  }
  cout << ans;
}
