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