#include <bits/stdc++.h>
int main() {
  int i, N;
  int tmp;
  int max = 0;
  scanf("%d", N);
  for (i = 0; i < N; i++) {
    scanf("%d", &tmp);
    if (max > tmp) {
      max = tmp;
    }
  }
  printf("%d\n", max);
  return 0;
}
