#include <iostream>
#include <string>
#include<math.h>
#include<vector>
#include <algorithm>
int main()
{
int z=0, n,k;
std::vector<int> v;
std::cin >> n;
while(n-- && std::cin >>k){
v.push_back(k) ;
}
int max = *max_element(v.begin(), v.end());
std::cout << max << std::endl;
return 0;
}