#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  int ans = INT_MIN;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    ans = max(ans, arr[i]);
  }
  cout << ans;
}
