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