program pil_12_14(input,output);

function Max:integer;
var
  prev, cur : integer;
begin
  read(prev);
  if prev=0 then Max:=0
  else begin
    cur:=Max;
    if prev>cur then Max:=prev
    else Max:=cur;
  end;
end;

begin
  writeln(Max);
end.

