program zysfj;
var n,i,j,k:longint;
begin
assign(input,'prime.in');reset(input);
assign(output,'prime.out');rewrite(output);
read(n);
for i:= n downto 1 do
if(n mod i=0)then
begin
j:=0;
for k:=2 to (n div i)-1 do
if((n div i) mod k=0)then
begin
j:=10;
break;
end;
for k:=2 to i-1 do
if(i mod k=0)then
begin
j:=10;
break;
end;
if(j<>10)then
begin
writeln(i);
break;
end;
end;
close(input);
close(output);
end.