#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
vector<char> v1[100];
vector<char> v2;
int main() {
  long long n;
  cin >> n;
  long long a[n + 5];
  long long mx = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    mx = max(mx, a[i]);
  }
  cout << mx << endl;
}
