#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long inf64 = 1e18;
const int N = 1e5 + 5;
const int D = 1005;
int n, d;
long long need[D][D];
bool check(int len) {
  vector<vector<long long> > have(d + d, vector<long long>(d + d));
  vector<long long> a(d + d);
  for (int i = 0; i < d; i++) {
    if (len < i) continue;
    a[i] = a[i + d] = (len - i) / d + 1;
  }
  for (int di = 0; di <= d; di++) {
    for (int dj = 0; dj <= d; dj++) {
      int ok = 1;
      for (int i = 0; i < d; i++)
        for (int j = 0; j < d; j++)
          ok &= ((a[i + di] * a[j + dj]) >= need[i][j]);
      if (ok) return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int mn = inf;
  for (int x, i = 0; i < n; i++) {
    cin >> x;
    mn = min(mn, x);
  }
  cout << mn << "\n";
  return 0;
}
