#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int maxn = 1010, mod = 1e9 + 7;
int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n, t, m = 1 << 30;
  cin >> n;
  while (n--) cin >> t, m = min(m, t);
  cout << m << '\n';
  return 0;
}
