string inp;
int i = 0;
int max=0;
do
{
inp = Console.ReadLine();
if (inp != "end" && inp != "END")
{
int.TryParse(inp, out i);
max = i > max ? i : max;
}
else
{
Console.WriteLine(max.ToString ());
Console.ReadLine();
}
} while (inp != "end" || inp != "END");