var
i:integer;
a:array[1..20] of integer;
function fn(x:integer):integer;
begin
if x mod 10 = 4 then fn:=x div 2
else fn:=x;
end;
for i:=1 to 20 do
readln(a[i]);
a[i]:=fn(a[i]);
writeln(a[i]);
end.
var
i:integer;
a:array[1..20] of integer;
function fn(x:integer):integer;
begin
if x mod 10 = 4 then fn:=x div 2
else fn:=x;
end;
begin
for i:=1 to 20 do
readln(a[i]);
for i:=1 to 20 do
begin
a[i]:=fn(a[i]);
writeln(a[i]);
end;
end.