import numpy as np X =int(input()) M =int(np.sqrt(X)) for i in range(M): if X %((M-i)**2) == 0: print(X//((M-i)**2)) break