Var a,p,i :integer;beginreadln(p);for a:=100 to 999 doif (a mod p=0) and (a<>p) then i:=a ;writeln(i);end.
Var a,p,i :integer;
begin
readln(p);
for a:=100 to 999 do
if (a mod p=0) and (a<>p) then
i:=a ;
writeln(i);
end.