#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p, ans = 1e9;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> p;
    ans = min(ans, p);
  }
  cout << ans << endl;
  return 0;
}
