print((function (n) local r,i,t = {},2,n while i^2<=n do if t%i==0 then if i>2 then return i end t=t/i end i=i+1 end if t>2 then return t end return n end)(io.stdin:read("*n")))