function f(m, n) function f1(i,r) if i>2 then return f1(i-1,n%i==0 and i or r) end return r end function f2(i) return (i~=4 and n%2==0) and i/2 or i end local r=f1(m,0) return r==0 and f2(n) or r end function g(n) return math.floor(math.sqrt(n)) end function h(n) return f(g(n),n) end print(h(io.stdin:read("*n")))