#include <iostream>
using namespace std;
int main()
{
int max,x;
cin>>x;
max=x;
while(x!=0){
cin>>x;
if(x>max){
max=x;
}
}
cout<<max;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int max,x;
cin>>x;
max=x;
while(x!=0){
cin>>x;
if(x>max){
max=x;
}
}
cout<<max;
return 0;
}