#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
int N, M, K, H, W, L, R;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  vector<int> v(N);
  int ans = MOD;
  for (auto& i : v) cin >> i;
  for (auto i : v) ans = min(ans, i);
  cout << ans << endl;
}
