/******************************************************************************
trovare il massimo in un vettore di interi
*******************************************************************************/
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
//ifstream fin("input.txt");
//ofstream fout("output.txt");
int trova_massimo(int N, vector<int> V);
int trova_massimo(int N, vector<int> V)
{
int max = V[0];
for(int i=1; i<V.size(); i++)
{
if(V[i]>max)
{
max=V[i];
}
}
return max;
}
int main()
{
int N;
cin>>N;
vector<int> vettore;
for(int i=0; i<N; i++)
{
int X;
cin>>X;
vettore.push_back(X);
}
int max = trova_massimo(N,vettore);
cout<<max;
return 0;
}