степень
Program Jopascal;
Var
i, A: longint;
x,
u, j,
N, m : longint;
Function FDiv (A, left : LongInt) : LongInt;
var
d,
i : longint;
begin
d := 1;
for i := left to Trunc (Sqrt (A)) do
if (A mod i = 0)
then
begin
d := i;
Break;
end;
if (d <> 1)
then
FDiv := d
else
FDiv := A;
end;
Function g (N, u : longint) : longint;
var
i : longint;
begin
i := 0;
while (N mod u = 0)
do
begin
Inc (i);
N := N div u;
end;
g := i;
end;
Begin
Assign (Input, 'input.txt');
Assign (Output, 'output.txt');
Reset (Input);
Read (A);
Close (Input);
m := 0;
N := 1;
i := FDiv (A, 2);
u := 2;
while (A > 1)
do
begin
N := N * i;
j := 0;
while (A mod i = 0)
do
begin
Inc (j);
A := A div i;
end;
if (j > m)
then
begin
m := j;
u := i;
end;
i := FDiv (A, i + 2);
end;
x := 1;
while (g (N * x, u) * N * x < m)
do
Inc (x);
N := N * x;
ReWrite (Output);
Write (N);
Close (Output);
End.