#include <bits/stdc++.h>
using namespace std;
int n;
int a[100000];
int main() {
  cin >> n;
  int i, minA = 1000000007;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    minA = min(minA, a[i]);
  }
  cout << minA << endl;
  return 0;
}
