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