var s:string;i:byte;beginread(s);if (length(s)=1)and (s='5') then writeln(' ') else begin
while i<>length(s) dobegini:=i+1;if copy(s,i,1)='5' then begin delete (s,i,1); i:=i-1; end;end;writeln(s);end;end.
var s:string;
i:byte;
begin
read(s);
if (length(s)=1)and (s='5') then writeln(' ') else begin
while i<>length(s) do
begin
i:=i+1;
if copy(s,i,1)='5' then begin delete (s,i,1); i:=i-1; end;
end;
writeln(s);
end;
end.