#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
long long mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
long long llmax = 9223372036854775807;
long long llmin = -9223372036854775807;
int iinf = intmax / 8;
long long inf = llmax / 8;
double eps = 1e-11;
int main() {
  long long N;
  cin >> N;
  long long a[N];
  long long minnum = 1e10;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    minnum = min(minnum, a[i]);
  }
  long long ans = minnum;
  cout << ans << endl;
}
