#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<long long> a(n);
  for (long long &i : a) cin >> i;
  cout << *max_element(a.begin(), a.end()) << endl;
  return 0;
}
