print((function (n) for i=3,math.floor(math.sqrt(n)) do if n%i==0 then return i end end return (n==4 and 4) or (n%2==0 and n/2) or n end)(io.stdin:read("*n")))