#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long arr[n];
  for (long long& e : arr) cin >> e;
  long long ans = *max_element(arr, arr + n);
  cout << ans << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  solve();
  return 0;
}
