var
max,a : integer;
begin
readln (a);
max :=a;
repeat
if (a> max) and (a<> 0) then
until a=0;
writeln (max);
readln;
end.
var
max,a : integer;
begin
readln (a);
max :=a;
repeat
readln (a);
if (a> max) and (a<> 0) then
max :=a;
until a=0;
writeln (max);
readln;
end.