#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n + 1];
  a[0] = 0;
  for (int i = 1; i < n + 1; i++) cin >> a[i];
  int max = -1;
  for (int i = 0; i < n + 1; i++) {
    if (a[i] > max) max = a[i];
  }
  cout << max << endl;
  return 0;
}
