#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long ans = 0;
  long long cur = 0;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int mx = 0;
  for (int i = 1; i <= n; ++i) mx = max(mx, a[i]);
  ans = mx;
  cout << ans << "\n";
}
