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