#include <bits/stdc++.h>
using namespace std;
int N, a[1001], tmp;
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= N; i++) {
    for (int j = i + 1; j <= N + 1; j++) {
      if (a[i] > a[j]) {
        tmp = a[i];
        a[i] = a[j];
        a[j] = tmp;
      }
    }
  }
  cout << tmp << endl;
}
