#include<iostream>
using namespace std;
int main()
{
int N,a,b,m;
cin>>N;
cin>>a;
m =a;
///循环
while(N-1>0)
{
cin>>b;
if(m<b)
m=b;
N--;
}
cout<<m;
return 0;
}