X = int(input()) r = int(X**0.5) + 10 ans = X for i in range(1, r): if X % (i**2) == 0: ans = X // (i**2) print(ans)