#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	
	
	ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    int n;
    cin  >> n;
    
    vector<int> ted(n);
    
        for(int i = 0; i < n; i++)
        {        cin >> ted[i]; 
        
        }
        sort( ted.begin(), ted.end()); 
        
        
        
        cout<< ted[n-1];
        
        
        
        

	return 0;
}